-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

===========================================================================
             AUSCERT External Security Bulletin Redistribution

                               ESB-2022.0840
       GitLab Critical Security Release: 14.8.2, 14.7.4, and 14.6.5
                             28 February 2022

===========================================================================

        AusCERT Security Bulletin Summary
        ---------------------------------

Product:           GitLab Community Edition
                   GitLab Enterprise Edition
Publisher:         GitLab
Operating System:  Windows
                   UNIX variants (UNIX, Linux, OSX)
                   Virtualisation
Resolution:        Patch/Upgrade
CVE Names:         CVE-2022-0751 CVE-2022-0741 CVE-2022-0738
                   CVE-2022-0735 CVE-2022-0549 CVE-2022-0489
                   CVE-2021-4191  

Original Bulletin: 
   https://about.gitlab.com/releases/2022/02/25/critical-security-release-gitlab-14-8-2-released/

Comment: CVSS (Max):  9.6 CVE-2022-0735 (CVSS:3.0/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:N)
         CVSS Source: GitLab
         Calculator:  https://www.first.org/cvss/calculator/3.0#CVSS:3.0/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:N

- --------------------------BEGIN INCLUDED TEXT--------------------

GitLab Critical Security Release: 14.8.2, 14.7.4, and 14.6.5

Learn more about GitLab Critical Security Release: 14.8.2, 14.7.4, and 14.6.5
for GitLab Community Edition (CE) and Enterprise Edition (EE).

Updated 00:00 UTC 2022-02-26 We have updated this blog post with hotpatch
instructions for self-managed instances running select versions older than 14.6

We strongly recommend that all GitLab installations be upgraded to one of these
versions immediately.

Note regarding Runner registration token disclosure: This update will reset
runner registration tokens for your group and projects. If you use an automated
process (scripts that encode the value of the registration token) to register
runners, this update will break that process. However, it should have no affect
on previously registered runners. If applicable to your processes, your
administrator may choose to save a backup of your existing tokens which can
later help identify potentially malicious registration tokens, or rogue
runners. For example, if an unauthorized actor tries to register a runner using
one of the revoked tokens, knowing that value will help admins monitor that
type of activity.

Today we are releasing versions 14.8.2, 14.7.4, and 14.6.5 for GitLab Community
Edition (CE) and Enterprise Edition (EE). Please note, this critical release
will also serve as our monthly security release for February.

These versions contain important security fixes, and we strongly recommend that
all GitLab installations be upgraded to one of these versions immediately.
GitLab.com is already running the patched version.

GitLab releases patches for vulnerabilities in dedicated security releases.
There are two types of security releases: a monthly, scheduled security
release, released a week after the feature release (which deploys on the 22nd
of each month), and ad-hoc security releases for critical vulnerabilities. For
more information, you can visit our security FAQ. You can see all of our
regular and security release blog posts here. In addition, the issues detailing
each vulnerability are made public on our issue tracker 30 days after the
release in which they were patched.

We are dedicated to ensuring all aspects of GitLab that are exposed to
customers or that host customer data are held to the highest security
standards. As part of maintaining good security hygiene, it is highly
recommended that all customers upgrade to the latest security release for their
supported version. You can read more best practices in securing your GitLab
instance in our blog post.

Recommended Action

We strongly recommend that all installations running a version affected by the
issues described below are upgraded to the latest version as soon as possible.

Table of Fixes

                                Title                                  Severity
Runner registration token disclosure through Quick Actions             critical
Unprivileged users can add other users to groups through an API        medium
endpoint
Inaccurate display of Snippet contents can be potentially misleading   medium
to users
Environment variables can be leaked via the sendmail delivery method   medium
Unauthenticated user enumeration on GraphQL API                        medium
Adding a pull mirror with SSH credentials can leak password            medium
Denial of Service via user comments                                    low

Runner registration token disclosure through Quick Actions

An issue has been discovered in GitLab CE/EE affecting all versions starting
from 12.10 before 14.6.5, all versions starting from 14.7 before 14.7.4, all
versions starting from 14.8 before 14.8.2. An unauthorized user was able to
steal runner registration tokens through an information disclosure
vulnerability using quick actions commands. This is a critical severity issue
(CVSS:3.0/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:N, 9.6). It is now mitigated in the
latest release and is assigned CVE-2022-0735.

This vulnerability was found internally by a member of the GitLab team.

Unprivileged users can add other users to groups through an API endpoint

An issue has been discovered in GitLab CE/EE affecting all versions before
14.3.6, all versions starting from 14.4 before 14.4.4, all versions starting
from 14.5 before 14.5.2. Under certain conditions, GitLab REST API may allow
unprivileged users to add other users to groups even if that is not possible to
do through the Web UI. This is a medium severity issue (CVSS:3.0/AV:N/AC:L/PR:L
/UI:N/S:U/C:N/I:H/A:N, 6.5). It is now mitigated in the latest release and is
assigned CVE-2022-0549.

This vulnerability was reported to us by a customer.

Inaccurate display of Snippet contents can be potentially misleading to users

Inaccurate display of Snippet files containing special characters in all
versions of GitLab CE/EE allows an unauthorized actor to create Snippets with
misleading content, which could trick unsuspecting users into executing
arbitrary commands. This is a medium severity issue (CVSS:3.0/AV:N/AC:L/PR:L/
UI:N/S:U/C:N/I:H/A:N, 6.5). It is now mitigated in the latest release and is
assigned CVE-2022-0751.

Thanks st4nly0n for reporting this vulnerability through our HackerOne bug
bounty program.

Note

This fix modifies our GraphQL API by adding the hasUnretrievableBlobs field to
the SnippetBlobConnection type. It indicates if the snippet has unretrievable
blobs. Please be aware of deploying this change if you use multi-version
deployments. We encourage users to include this patch in all deployed server
instances.

Environment variables can be leaked via the sendmail delivery method

Improper input validation in all versions of GitLab CE/EE using sendmail to
send emails allowed an unauthorized actor to steal environment variables via
specially crafted email addresses. This is a medium severity issue (CVSS:3.0/
AV:N/AC:H/PR:H/UI:N/S:C/C:H/I:N/A:N, 5.8). It is now mitigated in the latest
release and is assigned CVE-2022-0741.

Thanks vakzz for reporting this vulnerability through our HackerOne bug bounty
program.

Unauthenticated user enumeration on GraphQL API

An issue has been discovered in GitLab CE/EE affecting all versions starting
from 13.0 and all versions starting from 14.4 before 14.8. Private GitLab
instances with restricted sign-ups may be vulnerable to user enumeration by
unauthenticated users through the GraphQL API. This is a medium severity issue
(CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N, 5.3). It is now mitigated in the
latest release and is assigned CVE-2021-4191.

Thanks mungsul and todb-r7 for reporting this vulnerability through our
HackerOne bug bounty program.

Adding a pull mirror with SSH credentials can leak password

An issue has been discovered in GitLab affecting all versions starting from
14.6 before 14.6.5, all versions starting from 14.7 before 14.7.4, and all
versions starting from 14.8 before 14.8.2. GitLab was leaking user passwords
when adding pull mirrors with SSH credentials under specific conditions. This
is a medium severity issue (CVSS:3.0/AV:N/AC:H/PR:H/UI:R/S:U/C:H/I:N/A:N, 4.2).
It is now mitigated in the latest release and is assigned CVE-2022-0738.

This vulnerability has been discovered internally by the GitLab team.

Denial of Service via user comments

An issue has been discovered in GitLab CE/EE affecting all versions starting
with 8.15. It was possible to trigger a DOS by using the math feature with a
specific formula in issue comments. This is a low severity issue (CVSS:3.0/AV:N
/AC:L/PR:L/UI:R/S:U/C:N/I:N/A:L, 3.5). It is now mitigated in the latest
release and is assigned CVE-2022-0489.

Thanks cancerz for reporting this vulnerability through our HackerOne bug
bounty program.

Update Grafana

The version of Grafana has been updated to 7.5.12 in order to mitigate security
concerns.

Versions affected

Affects all versions of GitLab CE/EE.

Update Mattermost

The version of Mattermost has been updated to 6.3.3 in order to mitigate
security concerns.

Versions affected

Affects GitLab Omnibus prior to 14.8.

Updating

To update GitLab, see the Update page. To update Gitlab Runner, see the
Updating the Runner page.

Hotpatch for Runner registration token disclosure through Quick Actions

For self-managed instances not on versions 14.6 or greater, GitLab has
published patches which can be applied to mitigate the Runner registration
token disclosure through Quick Actions vulnerability. These patches should be
considered temporary. Any instances of GitLab should be upgraded to a patched
version of 14.8.2, 14.7.4, or 14.6.5 as soon as possible.

Patches named security-patch-$VERSION.patch close the vulnerability which
exposed runner registration tokens via quick action commands, and patches named
token-prefix-patch-$VERSION.patch can optionally be applied to automate the
rotation of registration tokens which were potentially compromised.

Version-specific patches are available for GitLab releases 14.5.4, 14.4.5,
14.3.4, 14.2.7, 14.1.8, 14.0.12 and 13.12.15.

To apply the desired patch(es) on a GitLab omnibus instance, first retrieve the
appropriate patchfile(s) based on the version of your instance, and then follow
the below commands:

sudo su
cd ~
curl -JLO https://gitlab.com/gitlab-org/omnibus-gitlab/-/raw/14.8.2-Security-Hotpatches/config/patches/gitlab-rails/security-patch-14.0.patch
cd /opt/gitlab/embedded/service/gitlab-rails/
patch -p1 < ~/<name of patch file>
gitlab-ctl restart

As an alternative to applying the token-prefix-patch, instances with a small
number of groups and projects (under 10,000) can use the following rails
console commands to regenerate project & group runner registration tokens:

Project.in_batches(of: 100).update_all(runners_token_encrypted: nil)
Group.in_batches(of: 100).update_all(runners_token_encrypted: nil)

GitLab has conducted limited testing to validate these patches. As such these
patches are provided AS-IS and GitLab makes no warranties of any kind. GITLAB
HEREBY DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING, WITHOUT
LIMITATION, ALL IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE, TITLE, AND NON-INFRINGEMENT.

- --------------------------END INCLUDED TEXT--------------------

You have received this e-mail bulletin as a result of your organisation's
registration with AusCERT. The mailing list you are subscribed to is
maintained within your organisation, so if you do not wish to continue
receiving these bulletins you should contact your local IT manager. If
you do not know who that is, please send an email to auscert@auscert.org.au
and we will forward your request to the appropriate person.

NOTE: Third Party Rights
This security bulletin is provided as a service to AusCERT's members.  As
AusCERT did not write the document quoted above, AusCERT has had no control
over its content. The decision to follow or act on information or advice
contained in this security bulletin is the responsibility of each user or
organisation, and should be considered in accordance with your organisation's
site policies and procedures. AusCERT takes no responsibility for consequences
which may arise from following or acting on information or advice contained in
this security bulletin.

NOTE: This is only the original release of the security bulletin.  It may
not be updated when updates to the original are made.  If downloading at
a later date, it is recommended that the bulletin is retrieved directly
from the author's website to ensure that the information is still current.

Contact information for the authors of the original document is included
in the Security Bulletin above.  If you have any questions or need further
information, please contact them directly.

Previous advisories and external security bulletins can be retrieved from:

        https://www.auscert.org.au/bulletins/

===========================================================================
Australian Computer Emergency Response Team
The University of Queensland
Brisbane
Qld 4072

Internet Email: auscert@auscert.org.au
Facsimile:      (07) 3365 7031
Telephone:      (07) 3365 4417 (International: +61 7 3365 4417)
                AusCERT personnel answer during Queensland business hours
                which are GMT+10:00 (AEST).
                On call after hours for member emergencies only.
===========================================================================
-----BEGIN PGP SIGNATURE-----
Comment: http://www.auscert.org.au/render.html?it=1967

iQIVAwUBYhwsO+NLKJtyKPYoAQi8rhAAnd7WTSbKSkGaXSUCH4HbJhW7o2Q9eutZ
TgVBLvS00wYXQhZv9suQ/0xucSWDJptp5aU3wgDvqpSVtkCu8fAKtdDxvh0gGUPj
VxlqsaPXIXvJctylpTPZkwO/UGdlVCi0+kruU0WWrHknu1e+ErHYFXgT7d/pdWiR
+jSHHm97lD0AUb/MkCvTsY/stRDm99G/9rCnBxay+dxeZSpvLdecvsRP08VBD0tq
xevwikxCZIS4mDRArYHLL/tsu1v3+wEkXi6BtOuCZRCUSXLI3y7rYeLs/pQUO7xn
Yp7dsFfULYnR9+R3DT5AjHgbqM4BGrLqcKGy8CKf0R1tCR65fxSL3Zye0O0Hm4Le
qU2WPnewqBncbjmnjwhyBArryfqfZ+clHS81Bnp2vmPeU1L5A6IpI1fz/ozeElEZ
ZDAFa+S+b1xdfMiaaHOjr2jlb1zV5xdSBITQ9DTK/0EPC2Fu0VWdfdLCwaBPeoeq
w6s1LzTvQmYuKDp+6BbUk0k256IZ9s73yKyL02MX+zn76QAECQ2EhwKGfeyTsKso
8V2smVyQbokiXehZ9L22HynI0JkdqGyXvLHxo2zDKaBAw/o1LcU/yiOZ0fI+aLJ4
wHNGHoAbVbPlb1Y136gGrct+Q3JUteudQev4tO9R69RcVQDajgL7yvHbojVFfN3j
lY3sfYigVw8=
=7ENT
-----END PGP SIGNATURE-----