CVE-2022-2884: GitLab Remote Command Execution Vulnerability
On August 22, 2022, GitLab officially issued a security notice to fix a critical vulnerability (CVE-2022-2884) in the Community Edition (CE) and Enterprise Edition (EE), with a CVSS score of 9.9. GitLab is an open-source project for a warehouse management system. It uses Git as a code management tool to access public or private projects through a web interface. This flaw is related to an authenticated user to achieve remote code execution via the Import from GitHub API endpoint. The bug was reported by security researcher ‘yvvdwf’ through HackerOne’s bug bounty program.
“A vulnerability in GitLab CE/EE affecting all versions starting from 11.3.4 before 15.1.5, all versions starting from 15.2 before 15.2.3, all versions starting from 15.3 before 15.3.1 allows an an authenticated user to achieve remote code execution via the Import from GitHub API endpoint. This is a Critical severity issue,” the company said in an advisory. “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.”
Affected version
- Gitlab CE/EE from 11.3.4 to before 15.1.5
- Gitlab CE/EE 15.2 prior to 15.2.3
- Gitlab CE/EE 15.3 prior to 15.3.1
Unaffected version
- Gitlab CE/EE 15.1.5
- Gitlab CE/EE 15.2.3
- Gitlab CE/EE 15.3.1
Solution
There is no evidence that the issue is being exploited in in-the-wild attacks. At present, GitLab has fixed the CVE-2022-2884 vulnerability in the latest version. We strongly recommend that all installations running a version affected by the issues described above are upgraded to the latest version as soon as possible.
If you’re unable to upgrade right away, you can secure your GitLab installation against this vulnerability using the workaround outlined below until you have time to upgrade.
Disable GitHub import
Login using an administrator account to your GitLab installation and perform the following:
- Click “Menu” -> “Admin”.
- Click “Settings” -> “General”.
- Expand the “Visibility and access controls” tab.
- Under “Import sources” disable the “GitHub” option.
- Click “Save changes”.
Verifying the workaround
- In a browser window, login as any user.
- Click “+” on the top bar.
- Click “New project/repository”.
- Click “Import project”.
- Verify that “GitHub” does not appear as an import option.