CVE-2021-22205
CVE-2021-22205 is a critical-severity vulnerability in Gitlab with a CVSS 3.x base score of 10.0. It is listed in CISA's Known Exploited Vulnerabilities (KEV) catalog, confirming it has been exploited in the wild (added 2021-11-03). The underlying weakness is classified as CWE-94.
Key facts
- Severity: Critical (CVSS 3.x base score 10.0)
- CVSS v2: 7.5
- EPSS exploit prediction: 100% (100th percentile)
- Actively exploited: Yes — listed in CISA KEV (added 2021-11-03)
- EU (EUVD) id: EUVD-2021-9351
- EU exploitation: Flagged exploited in the ENISA EU Vulnerability Database (since 2021-11-03)
- Weakness: CWE-94
- Affected product: Gitlab
- Published:
- Last modified:
Description
An issue has been discovered in GitLab CE/EE affecting all versions starting from 11.9. GitLab was not properly validating image files that were passed to a file parser which resulted in a remote command execution.
CVE-2021-22205: GitLab Unauthenticated Remote Command Execution via Malicious Image File Parsing
AI-generated analysis based on the vulnerability data on this page.
| Attribute | Value |
|---|---|
| CVE ID | CVE-2021-22205 |
| Published | 2021-04-23 |
| Modified | 2026-06-17 |
| CVSS v3.1 | 10.0 Critical |
| CVSS v2 | 7.5 |
| EPSS | 0.99731 |
| EPSS Percentile | 0.99952 |
| KEV | Yes (Added 2021-11-03) |
| EUVD | EUVD-2021-9351 |
| CWE | CWE-94 |
Summary
GitLab CE/EE versions from 11.9 onward failed to properly validate image files before passing them to an underlying file parser, allowing unauthenticated remote attackers to execute arbitrary commands on the host system.
Background
GitLab is a widely deployed web-based DevOps platform providing Git repository management, CI/CD pipelines, issue tracking, and more. The vulnerability resides in the way GitLab handles user-uploaded image files for processing and preview generation. Attackers could abuse this functionality without authentication, making it a high-value target for mass exploitation across internet-facing instances.
Root Cause
The vulnerability is classified as CWE-94: Improper Control of Generation of Code ('Code Injection'). The application accepted user-supplied image files and passed them directly to a backend file parser without sufficient content validation, sanitization, or sandboxing. Embedded malicious content within the image file was interpreted as executable commands by the parser, resulting in remote command execution.
Impact
This vulnerability is rated Critical with a CVSS 3.1 score of 10.0 (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H).
- Attack Vector (AV): Network — exploitable remotely without access to the target network.
- Attack Complexity (AC): Low — no special conditions or advanced techniques required.
- Privileges Required (PR): None — unauthenticated exploitation is possible.
- User Interaction (UI): None — fully automated attacks are feasible.
- Scope (S): Changed — exploitation can affect resources beyond the vulnerable component.
- Confidentiality (C): High — complete data disclosure is possible.
- Integrity (I): High — attackers can modify arbitrary data.
- Availability (A): High — attackers can completely disrupt service.
In practice, successful exploitation grants an attacker full remote code execution on the GitLab server, potentially leading to complete compromise of source code, CI/CD secrets, and lateral movement into connected infrastructure.
Exploitation Walkthrough
From a defensive perspective, the attack flow is as follows:
- Reconnaissance: An attacker identifies an internet-facing GitLab instance running an affected version.
- Payload Crafting: The attacker crafts a malicious image file containing embedded commands or metadata structures designed to be interpreted by the backend file parser.
- Upload: The attacker submits the file to a publicly accessible upload endpoint (such as issue attachments, project imports, or avatars) without authentication.
- Parser Abuse: GitLab passes the uploaded file to a file parser. Due to insufficient validation, the parser executes the embedded commands under the context of the GitLab application user.
- Post-Exploitation: The attacker leverages the initial foothold to deploy persistence mechanisms, exfiltrate data, or pivot to internal networks.
Ethics Caveat: This walkthrough is provided solely for defensive awareness and patch verification. Unauthorized exploitation of this vulnerability is illegal and unethical. All testing should be performed only on systems you own or have explicit written permission to test.
Affected and Patched Versions
- Affected: GitLab Community Edition (CE) and Enterprise Edition (EE) versions starting from 11.9.
- Patched: Specific patched version numbers were not provided in the available source data. Administrators should consult the official GitLab security releases for the appropriate upgrade path.
Remediation
- Upgrade: Apply the latest security patches from GitLab for your installed edition. Prioritize upgrading all internet-facing instances.
- Network Restrictions: Restrict access to the GitLab web interface to trusted IP ranges or VPNs where possible.
- Web Application Firewall (WAF): Deploy WAF rules to detect and block suspicious multipart uploads containing anomalous image metadata.
- Sandboxing: Run the GitLab application and its auxiliary services (including file parsers) inside isolated containers or virtual machines with strict seccomp/AppArmor profiles and minimal outbound network access.
- Disable Unneeded Uploads: If public uploads are not required, disable or restrict public issue attachments and project import features.
Detection
- Monitor HTTP access logs for unauthenticated
POSTrequests to upload endpoints (/uploads,/import,/projects) with unusual user agents or rapid sequential submissions. - Correlate application and system process logs for anomalous child processes spawned by the GitLab service account (e.g., unexpected shell, Perl, or Python processes).
- Monitor outbound network connections from the GitLab server for unexpected traffic to external IPs.
- Review GitLab production logs for errors or exceptions related to image processing or file parser timeouts.
- Scan for known post-exploitation indicators, including newly created users, unauthorized SSH keys, or modified CI/CD variables.
Assessment
With an EPSS score of 0.99731 (0.99952 percentile) and confirmed inclusion in CISA's Known Exploited Vulnerabilities (KEV) catalog as of 2021-11-03, this vulnerability is effectively guaranteed to be actively exploited in the wild. It was also assigned EUVD-2021-9351 with exploitation confirmed since the same date.
This case underscores the catastrophic risk of passing user-controlled files directly to complex parsers without strict validation. Two key lessons emerge:
- Validate before parsing: File type checks based on extensions or MIME types are insufficient. Implement deep content inspection, strict format validation, and parser sandboxing before handling untrusted files.
- Assume unauthenticated endpoints are high-risk: Any feature that accepts unauthenticated file uploads must be treated as a critical attack surface and subjected to the highest scrutiny during security architecture reviews.
References
- http://packetstormsecurity.com/files/164768/GitLab-Unauthenticated-Remote-ExifTool-Command-Injection.html
- http://packetstormsecurity.com/files/164994/GitLab-13.10.2-Remote-Code-Execution.html
- https://gitlab.com/gitlab-org/cves/-/blob/master/2021/CVE-2021-22205.json
- https://gitlab.com/gitlab-org/gitlab/-/issues/327121
- https://hackerone.com/reports/1154542
- https://www.cisa.gov/known-exploited-vulnerabilities-catalog?field_cve=CVE-2021-22205
Frequently asked questions
- What is CVE-2021-22205?
- An issue has been discovered in GitLab CE/EE affecting all versions starting from 11.9. GitLab was not properly validating image files that were passed to a file parser which resulted in a remote command execution.
- How severe is CVE-2021-22205?
- CVE-2021-22205 has a CVSS 3.x base score of 10.0, rated critical severity. It is exploitable over network with low attack complexity, requires no privileges and no user interaction. Impact on confidentiality is high, integrity high, and availability high.
- Is CVE-2021-22205 being actively exploited?
- Yes. CVE-2021-22205 is on CISA's Known Exploited Vulnerabilities (KEV) catalog, added on 2021-11-03, which means active exploitation has been confirmed. It should be prioritised for remediation.
- What products are affected by CVE-2021-22205?
- CVE-2021-22205 primarily affects Gitlab. In total, 2 product configurations (CPEs) are listed as vulnerable; see the affected-products list for the exact versions.
- How do I fix CVE-2021-22205?
- Review the linked vendor and NVD advisories for patched versions and mitigations, then upgrade or apply the recommended workaround. Because this CVE is known to be actively exploited, treat remediation as urgent — CISA KEV typically sets a short remediation deadline.
- Does CVE-2021-22205 have an EU (EUVD) identifier?
- Yes. CVE-2021-22205 is tracked in the ENISA EU Vulnerability Database (EUVD) as EUVD-2021-9351. It is also flagged as exploited in the EUVD (since 2021-11-03).
- When was CVE-2021-22205 published?
- CVE-2021-22205 was published on 2021-04-23 and last updated on 2026-06-17.
References
- http://packetstormsecurity.com/files/164768/GitLab-Unauthenticated-Remote-ExifTool-Command-Injection.html
- http://packetstormsecurity.com/files/164994/GitLab-13.10.2-Remote-Code-Execution.html
- https://gitlab.com/gitlab-org/cves/-/blob/master/2021/CVE-2021-22205.json
- https://gitlab.com/gitlab-org/gitlab/-/issues/327121
- https://hackerone.com/reports/1154542
- https://www.cisa.gov/known-exploited-vulnerabilities-catalog?field_cve=CVE-2021-22205
Affected products (2)
- cpe:2.3:a:gitlab:gitlab:*:*:*:*:community:*:*:*
- cpe:2.3:a:gitlab:gitlab:*:*:*:*:enterprise:*:*:*
More vulnerabilities in Gitlab
- CVE-2024-45409 — Critical (CVSS 10.0): The Ruby SAML library is for implementing the client side of a SAML authorization. Ruby-SAML in <= 12.2 and 1.13.0 <=…
- CVE-2023-7028 — Critical (CVSS 10.0): An issue has been discovered in GitLab CE/EE affecting all versions from 16.1 prior to 16.1.6, 16.2 prior to 16.2.9,…
- CVE-2023-2825 — Critical (CVSS 10.0): An issue has been discovered in GitLab CE/EE affecting only version 16.0.0. An unauthenticated malicious user can use a…
- CVE-2022-0735 — Critical (CVSS 10.0): An issue has been discovered in GitLab CE/EE affecting all versions starting from 12.10 before 14.6.5, all versions…
- CVE-2019-9174 — Critical (CVSS 10.0): An issue was discovered in GitLab Community and Enterprise Edition before 11.6.10, 11.7.x before 11.7.6, and 11.8.x…
- CVE-2018-18843 — Critical (CVSS 10.0): The Kubernetes integration in GitLab Enterprise Edition 11.x before 11.2.8, 11.3.x before 11.3.9, and 11.4.x before…
Other CWE-94 (Code Injection) vulnerabilities
- CVE-2026-57624 — Critical (CVSS 10.0): Unauthenticated Remote Code Execution (RCE) in Blocksy Companion Pro <= 2.1.46 versions.
- CVE-2026-10134 — Critical (CVSS 10.0): IBM Langflow OSS 1.0.0 through 1.9.3 allows an attacker to read every secret available to the Langflow process, read…
- CVE-2026-53576 — Critical (CVSS 10.0): Kestra is an open-source, event-driven orchestration platform. Prior to 1.0.45 and 1.3.21, the authentication filter…
- CVE-2026-10561 — Critical (CVSS 10.0): IBM Langflow OSS 1.0.0 through 1.9.3 has an vulnerability due to an improper isolation of Python execution combined…
- CVE-2026-25470 — Critical (CVSS 10.0): Improper Control of Generation of Code ('Code Injection') vulnerability in ACPT ACPT (Pro) - Custom Post Types Plugin…
- CVE-2026-48836 — Critical (CVSS 10.0): Unauthenticated Remote Code Execution (RCE) in Easy Invoice <= 2.1.19 versions.