Skip to main content
Mallory
CriticalExploited in the wildCISA KEVPublic exploitVulnerability

CVE-2021-22205: Unauthenticated Remote Code Execution in GitLab Image Parsing

Published Apr 23, 2021 · Updated 10 days ago
Trending this weekNot trendingOutside this week’s top 100
Mention activity · 30 days5 mentions · peak 2 in a dayToday
CVSS10.0Critical · v3.1
EPSS99.7%100th percentile
CISA KEVYesAdded Nov 3, 2021
In the wildActivePer CISA KEV
Vendor
GitLab
IdentifiersCVE-2021-22205CWE-95

CVE-2021-22205 is an unauthenticated remote code execution vulnerability in GitLab Community Edition and Enterprise Edition, introduced in version 11.9. GitLab insufficiently validates uploaded image files before passing them to its ExifTool-based parser. Crafted input containing a backslash followed by a newline can bypass validation and reach dynamic code evaluation, allowing attacker-controlled code or commands to execute. Historical fixes were released in GitLab 13.8.8, 13.9.6, and 13.10.3. The vulnerability has been exploited in ransomware, botnet, cryptomining, and other intrusion campaigns.

Do you run this?See affected versions in your environment and whether adversaries are exploiting this vulnerability against assets like yours.
Check your exposure
Analyst brief

Impact, mitigation & remediation

What it means and what to do now: patch path, interim mitigations, and the assume-compromise checklist.

Impact

What an attacker gets, and what they’ve been doing with it.

Successful exploitation compromises confidentiality, integrity, and availability within the permissions and isolation boundaries of the affected GitLab process. Attackers can execute commands, access or modify accessible application data and credentials, deploy malware or backdoors, and disrupt services. Observed exploitation has enabled ransomware deployment, botnet enrollment, cryptomining, and proxyjacking. Further privilege escalation or lateral movement depends on additional weaknesses or credentials available in the compromised environment; root access is not an inherent outcome.

Mitigation

If you can’t patch tonight, do this now.

Until an upgrade is completed, restrict network access to the GitLab instance to trusted clients through firewall rules, segmentation, or a controlled VPN. Because exploitation does not require authentication, stronger account authentication alone does not prevent it. Apply least privilege and workload isolation to limit consequences, and monitor GitLab-associated processes for unexpected shell execution, payload downloads, unauthorized remote-access tools, and anomalous outbound traffic. These measures reduce exposure or impact but do not correct the parser vulnerability.

Remediation

Patch, then assume compromise.

Upgrade GitLab CE or EE to a currently supported, patched release. Historical releases addressing this vulnerability are 13.8.8, 13.9.6, and 13.10.3 for their respective branches. For potentially compromised installations, patching alone is insufficient: isolate affected systems, preserve evidence, investigate persistence and lateral movement, remove unauthorized access, and rotate exposed credentials and keys.

Public exploits

Exploits

15 exploits validated by Mallory's analysis. Hidden: 1 not yet analyzed, such as Exploit-DB entries.

View more in app →
gitlab_exif_rce.rbThis repository contains a single Metasploit module (gitlab_exif_rce.rb) that exploits an unauthenticated remote command injection vulnerability in GitLab CE and EE (CVE-2021-22205, leveraging CVE-2021-22204 in ExifTool). The exploit works by uploading a specially crafted JPEG file to a vulnerable GitLab instance, triggering ExifTool to execute arbitrary commands as the 'git' user. The module supports both direct command execution and staged payloads (such as reverse shells or Meterpreter sessions), and is weaponized for operational use. The module includes logic to check if the target is a GitLab instance and whether it is vulnerable, and it provides options for different payload types. The only file in the repository is written in Ruby and is structured as a standard Metasploit exploit module, making use of the framework's HTTP client and command stager utilities. The main attack vector is network-based, targeting the GitLab web interface via HTTP POST requests to arbitrary URIs. No hardcoded IPs or domains are present; the module is designed to be used against user-specified targets.Disclosed Apr 14, 2021 · Framework: metasploit · ruby · networkWeaponizedGitlab-CVE-2021-22205This repository contains a functional unauthenticated remote code execution (RCE) exploit targeting GitLab instances running versions prior to 13.10.3 (CVE-2021-22205). The exploit leverages a vulnerability in the way GitLab processes image uploads, specifically by abusing ExifTool's handling of DjVu files. The main exploit script, 'exploit.py', is written in Python and automates the attack by: 1. Retrieving a CSRF token from the GitLab login page. 2. Crafting a malicious DjVu file with embedded shell commands using 'djvumake' and 'djvulibre'. 3. Renaming the DjVu file to a .jpg extension. 4. Uploading the file to the '/uploads/user' endpoint of the target GitLab instance. 5. Triggering code execution on the server if the file is processed. 6. Cleaning up temporary files. The exploit requires no authentication and only needs network access to the target GitLab instance. The payload is customizable via command-line arguments, allowing the attacker to specify arbitrary shell commands to execute on the target. The repository includes a README with background information, usage instructions, and references to the original vulnerability report and write-ups. The only code file is 'exploit.py', which serves as the entry point for the exploit.mr-r3bot · Disclosed Jun 5, 2021 · python · networkOperationalCVE-2021-22205This repository contains a Python proof-of-concept exploit for CVE-2021-22205, a critical unauthenticated remote code execution vulnerability in GitLab CE/EE (versions prior to 13.10.3, 13.9.6, and 13.8.8). The exploit works by first retrieving a CSRF token from the /users/sign_in endpoint, then crafting a malicious DJVU image file with an embedded shell command in its metadata. This file is uploaded via a POST request to the /uploads/user endpoint, exploiting improper file handling to execute arbitrary commands on the server. The exploit is operational, requiring only the target URL and a shell command as arguments. The repository consists of the main exploit script (CVE-2021-22205.py) and a README.md with usage instructions and references. No authentication is required, and the attack vector is network-based, targeting exposed GitLab web interfaces.r0eXpeR · Disclosed Oct 28, 2021 · python · networkOperationalCVE-2021-22205This repository provides a Python exploit script (CVE-2021-22205.py) targeting a remote command execution vulnerability in GitLab CE/EE (CVE-2021-22205). The exploit abuses improper validation of image files, allowing attackers to upload a specially crafted image that triggers arbitrary command execution on the server. The script supports three modes: verification (checks if the target is vulnerable), attack (executes a supplied command), and batch scan (tests multiple targets from a file). The exploit works by first retrieving a CSRF token from the target's sign-in page, then uploading a malicious image to the /uploads/user endpoint. The payload can be customized to execute any system command, including establishing a reverse shell. The repository includes a README.md with usage instructions, affected product versions, and example payloads. The target.txt file provides an example target URL. The exploit is operational and can be used to gain remote code execution on vulnerable GitLab instances.Al1ex · Disclosed Oct 29, 2021 · python · networkOperationalCVE-2021-22205This repository contains a Python exploit script (exploit.py) targeting CVE-2021-22205, a critical unauthenticated remote code execution vulnerability in GitLab (versions prior to 13.10.3). The exploit works by generating a malicious JPEG file in-memory (removing the need for external tools like djvumake or djvulibre) and uploading it to the vulnerable GitLab instance via the /uploads/user endpoint. The script supports both authenticated and unauthenticated exploitation, depending on whether valid GitLab credentials are provided. The attacker can specify an arbitrary command to execute on the target server. The repository structure is simple, consisting of the main exploit script and a README.md file with usage instructions. The exploit leverages network access to the target GitLab instance and does not require prior authentication, though it supports authenticated attacks as well. No hardcoded IPs or domains are present; the target URL is supplied by the user at runtime.whwlsfb · Disclosed Oct 30, 2021 · python · networkOperationalGitLab-CVE-2021-22205-scannerThis repository contains two main Python scripts targeting GitLab instances vulnerable to CVE-2021-22205, a remote code execution vulnerability in the ExifTool integration. The primary script, 'GitLab-revshell.py', is an exploit that crafts a malicious DjVu image file containing a base64-encoded bash reverse shell payload. It uploads this file to the '/uploads/user' endpoint of a target GitLab server after retrieving a CSRF token from '/users/sign_in'. If successful, the exploit spawns a reverse shell to the attacker's specified IP and port. The script requires the 'djvumake' utility to be installed on the attacker's machine. The second script, 'shodan-scanner.py', is a scanner that uses the Shodan API to find potential vulnerable GitLab instances on the internet. For each discovered target, it attempts to upload a similar malicious DjVu file (with a DNS exfiltration payload) to test for the vulnerability, logging results to a file. The repository also includes a README with usage instructions and credits, and a .gitignore file. The exploit is operational, providing a working reverse shell payload, and is not part of a larger framework. The main attack vector is network-based, targeting accessible GitLab servers via HTTP(S) endpoints.faisalfs10x · Disclosed Nov 9, 2021 · python · networkOperationalCVE-2021-22205This repository contains a Python exploit script (CVE-2021-22205.py) targeting the unauthenticated remote code execution (RCE) vulnerability in GitLab CE/EE (CVE-2021-22205). The exploit leverages improper image file validation in GitLab's ExifTool integration, allowing attackers to execute arbitrary commands on the server by uploading a malicious image file. The script supports several attack modes: version detection, command execution (via out-of-band channels or direct file write), reverse shell, SSH key injection, and user account manipulation (add, modify, restore passwords). It automates out-of-band (OOB) verification using DNSLog, PostBin, and RequestBin services, whose endpoints are hardcoded in the script. The repository consists of the main exploit script and a README.md with detailed usage instructions, affected versions, and references. The exploit is operational, providing real-world attack capabilities against vulnerable GitLab instances without requiring authentication.inspiringz · Disclosed Nov 11, 2021 · python · networkOperationalCVE-2021-22205-gitlabThis repository contains a Python exploit script (CVE-2021-22205.py) targeting CVE-2021-22205, a critical remote command execution vulnerability in GitLab CE/EE versions prior to 13.10.3. The exploit abuses improper validation of image files, allowing an attacker to upload a specially crafted image with embedded OS commands in its metadata. The script supports three main modes: vulnerability check (verifies if a target is vulnerable), attack (executes arbitrary commands on the target), and batch scan (scans multiple targets from a file). The exploit works by first retrieving a CSRF token from the /users/sign_in endpoint, then uploading the malicious image to /uploads/user. The README provides detailed usage instructions, including examples for command execution and reverse shell payloads. The repository structure is simple, with the main exploit script, a README, and a sample target list file. The exploit is operational and allows for arbitrary command execution, making it a significant risk for unpatched GitLab instances.osungjinwoo · Disclosed Mar 10, 2022 · python · networkOperationalcve-2021-22205-GitLab-13.10.2---Remote-Code-Execution-RCE-Unauthenticated-This repository consists of a single file, 'Poc.txt', which provides step-by-step instructions for generating and delivering a malicious DjVu image payload. The payload is constructed by embedding a base64-decoded reverse shell command into a DjVu image file ('lol.jpg'). The exploit targets a file upload endpoint on a remote server (example: http://10.0.0.7/...), where the attacker uploads the crafted image. When the image is processed by the vulnerable service, it triggers a reverse shell connection from the target to the attacker's machine (10.0.0.3) on TCP port 1270. The instructions also include how to listen for the incoming shell using netcat. The exploit is operational and demonstrates a practical attack scenario, but does not reference a specific CVE or product. The main attack vector is network-based, leveraging file upload and remote code execution via a crafted image file.momika233 · Disclosed Apr 18, 2022 · bash · text · networkOperationalCVE-2021-22205This repository provides a Python exploit script (CVE-2021-22205.py) targeting a remote command execution vulnerability in GitLab CE/EE (CVE-2021-22205). The exploit abuses improper validation of image files, allowing attackers to upload a specially crafted image that triggers arbitrary command execution on the server. The script supports three main modes: vulnerability check (verifies if the target is vulnerable), attack (executes arbitrary commands), and batch scan (scans multiple targets from a file). The README.md provides detailed usage instructions, including examples for command execution and reverse shell payloads. The exploit interacts with the GitLab web interface, specifically the '/users/sign_in' endpoint to retrieve a CSRF token and the '/uploads/user' endpoint to upload the malicious file. The default payload includes a DNS exfiltration command to verify code execution. The repository is operational and can be used to achieve remote code execution on vulnerable GitLab instances.ccordeiro · Disclosed Nov 19, 2025 · python · networkOperationalabyss-c2This repository is a multi-module Python offensive framework centered on exploiting HiSilicon DVR/NVR/IP camera devices via CVE-2020-25078, then managing compromised hosts through a Flask/SocketIO web panel. It is not a simple single-file PoC: it includes a control server (server.py), persistence and post-exploitation tooling, credential attacks, recon modules, web vulnerability scanners, network service checks, pivoting, reverse shell support, and a SQLite-backed datastore. Core exploit logic is in exploit.py and scanner.py. exploit.py probes numerous traversal/disclosure paths such as /../../.../mnt/mtd/Config/Account1 and related config/system files, parses returned content with multiple regex patterns to recover credentials, fingerprints device families, and falls back to known default credentials when disclosure succeeds but parsing does not. scanner.py operationalizes this by scanning IPs/CIDRs and common ports, checking liveness, fingerprinting likely cameras, invoking the CVE-2020-25078 checks, and storing recovered credentials in cameras.db. Post-exploitation capability is substantial. telnet_client.py provides raw Telnet login and command execution. botnet.py fans out commands across stored hosts. persistence.py installs SSH authorized_keys, cron, rc.local, init.d, systemd, inittab telnetd, and bind-shell style persistence. reverse_shell.py generates many Linux/IoT reverse shell one-liners and runs listeners. pivot_chain.py and socks_pivot.py support chained execution and local SOCKS5 pivoting through compromised hosts. Additional modules broaden scope beyond the HiSilicon exploit: brute.py and cred_spray.py perform credential attacks across Telnet, SSH, FTP, HTTP, SMB, databases, VNC, LDAP, WinRM, and more; network_exploit.py checks for exposed/misconfigured services and some well-known vulnerabilities such as MS17-010 and BlueKeep; web_exploit.py, web_cves.py, web_bugs.py, and web_brute.py scan websites for exposed files, CMS fingerprints, generic bug classes, and multiple CVE signatures. Recon/intel support includes ASN, DNS, GeoIP, JARM, WAF detection, proxy/Tor rotation, screenshot grabbing from camera snapshot endpoints, and Telegram/Discord/AbuseIPDB integrations. The repository structure is coherent and functional, with many CLI-capable modules and a central web UI in templates/index.html. Overall, this is an operational exploit-and-post-exploitation toolkit focused on HiSilicon IoT devices but expanded into a broader C2-style offensive platform.flags-alt · Disclosed May 20, 2026 · python · html · network · web · localOperationalCVE-2021-22205This repository is a small standalone exploit PoC for GitLab unauthenticated RCE via CVE-2021-22205. It contains two files: a README describing the vulnerability and impact, and a single Python exploit script. The script is the operational component. It generates a malicious DjVu-based payload by combining two hardcoded binary blobs with an injected command string. That command is a base64-wrapped bash reverse shell that connects back to an attacker-supplied LHOST and LPORT. The exploit then starts a local TCP listener, uploads the crafted file to the target over HTTP POST using the requests library, and waits for an inbound shell connection. If the callback arrives, it provides an interactive shell over the socket using select() to multiplex stdin and the remote connection. Structurally, exploit.py has four main functions: generate_malicious_djvu() builds the malicious file; upload_exploit() sends it to the target URL with a random 8-character path suffix; listener_thread() binds and waits up to 60 seconds for the reverse shell; and interactive_shell() provides operator interaction with the compromised host. The main() function parses arguments, launches the listener and uploader in separate threads, and transitions into shell handling on success. The exploit’s primary capability is unauthenticated remote code execution against vulnerable GitLab CE/EE instances, resulting in an interactive reverse shell. It is not a scanner or detection script. It is best classified as OPERATIONAL rather than WEAPONIZED because it includes a working hardcoded reverse-shell payload but lacks broader framework integration, target validation, or payload modularity. Notably, the upload path in the code is a generic random URL suffix rather than a clearly GitLab-specific known endpoint, which may indicate the PoC is simplified or assumes a particular routing condition; however, the intended purpose is clearly exploitation of CVE-2021-22205 through malicious file upload and ExifTool processing.K3ysTr0K3R · Disclosed Jun 24, 2026 · markdown · python · web · networkOperationalvulhub-gitlab-cve-2021-22205This is a deliberately vulnerable GitLab lab with a genuine standalone exploit, not a Metasploit or Nuclei module. The Nuclei URL appears only as a documentation reference; Isoloom provides deployment orchestration rather than an exploit framework. The 38 supplied files include one Python exploit, nine shell checks, seven Terraform modules, one Ruby Vagrantfile, three Dockerfiles, and nine YAML deployment/workflow files. The code-file count includes infrastructure and workflow definitions. app/ vendors the Vulhub walkthrough, original Compose configuration, and poc.py; base/ records the upstream GitLab image Dockerfile; build/ creates environment-configured GitLab and PostgreSQL overlays. isoloom.yml defines the three-service lab, while .isoloom/ contains generated Docker, Kubernetes, VM, Proxmox, and six cloud-provider deployment outputs. .github/ validates and publishes the lab, and .ctf/ supplies challenge metadata. app/poc.py accepts a target URL and arbitrary command, builds a DjVu annotation containing Perl qx command execution, obtains an anonymous CSRF token/session from /users/sign_in, and posts the bytes to /uploads/user disguised as test.jpg. This exploits GitLab's upload processing exposure, CVE-2021-22205, through ExifTool's underlying DjVu parser vulnerability, CVE-2021-22204. The implementation supplies no output channel or execution confirmation: it ignores the upload response and reports completion regardless of exploit success. Its CSRF regex assumes specific page markup, it has no request timeout or robust error handling, and payload lengths use character counts rather than encoded-byte counts, making non-ASCII commands potentially malformed. The lab runs GitLab CE 13.10.1, PostgreSQL 12, and Redis 5.0.9. GitLab HTTP and SSH are intended to publish on ports 8080 and 10022; generated Docker defaults bind to loopback and can allocate ports dynamically. Route-removal sidecars and Kubernetes network policies restrict outbound internet access, so external command callbacks may fail. Isolation checks probe 1.1.1.1 expecting failure; this is not malicious infrastructure. Default root/database credentials and application secrets are deliberately fixed for the lab. The shell 'version' check only matches 'GitLab Community Edition' branding and does not actually validate version 13.10. Administrative rm -rf commands occur in CI cleanup and VM provisioning, not in the exploit payload, and do not indicate a fake exploit. Analysis is static; execution was not verified. The original repository URL, analyzed ref, and archive size were not supplied, so repository URL/ref are empty and size_bytes is an unknown-value placeholder of 0. The documented Vulhub commit 8fd63916f7a8711e2e01dda0d27237e4d6175d38 identifies vendored upstream content, not the analyzed repository ref.CyberCTF · Disclosed Oct 8, 2026 · python · sh · web · network · fileOperationalCVE-2021-22205The repository contains one standalone Python exploit, exploit.py, plus README.md, SECURITY.md, LICENSE, and .gitignore. It targets GitLab CVE-2021-22205 by chaining pre-authentication upload processing with ExifTool's DjVu Perl-evaluation vulnerability, CVE-2021-22204. The visible builder constructs the DjVu container entirely in memory using Python struct, avoiding a djvulibre dependency. A malicious ANTa annotation executes an operator-supplied shell command through Perl qx; an included helper generates a Bash reverse shell. The CLI supports anonymous and authenticated vectors, checking, proxy configuration, TLS-verification bypass, timeouts, and overriding GitLab fingerprint checks. Main also invokes fingerprinting, version reporting, login, checking, and upload functions, but their implementations are omitted from the supplied excerpt. Documentation describes anonymous uploads to random root-level paths and authenticated uploads to /uploads/user. Check mode submits invalid image data and interprets HTTP 422 versus 404 as vulnerable versus patched behavior. This is a heuristic, not proof of command execution. The request wrapper treats read timeouts as a held-open condition; a timeout alone likewise does not establish exploit success. Exploitation is blind and may leave upload artifacts and logs; authenticated use additionally leaves session-related logs. No fixed callback or exfiltration service is evident, and reference URLs are documentation rather than runtime destinations. The source is materially truncated, so the full request construction, login flow, command validation, and success criteria cannot be independently verified. Nothing visible suggests a fake exploit, but execution was not tested. The original repository URL, Git reference, and archive size were not supplied; empty strings and zero represent unavailable metadata. Listed file sizes total 24,621 bytes, which is not a verified archive size.d4ytox · Disclosed Nov 10, 2026 · python · web · networkOperationalGitLab-preauth-RCE_CVE-2021-22205This repository contains a single file, README.md, which provides a one-line Bash proof-of-concept (PoC) exploit for CVE-2021-22205, a pre-authentication remote code execution vulnerability in GitLab CE/EE. The exploit crafts a malicious image file (1.jpg) containing a payload that, when processed by a vulnerable GitLab instance, results in arbitrary command execution. The Bash command in the PoC uploads this file to the target GitLab server using the /uploads/user endpoint, after retrieving a CSRF token from the /users/sign_in page. The payload is a base64-encoded reverse shell, which, when executed, connects back to the attacker's machine. The repository also includes a sample Ruby reverse shell payload. No actual code files are present beyond the README, but the exploit is functional and demonstrates the vulnerability. The repository targets GitLab instances vulnerable to CVE-2021-22205 and is intended for security testing and research purposes.findneo · Disclosed Oct 30, 2021 · bash · ruby · networkPoC
Exposure surface

Affected products & vendors

Products and vendors Mallory has correlated with this vulnerability. Open in Mallory to drill down to specific CPE configurations and version ranges.

VendorProductType
GitLabGitlabapplication
FAQ

Frequently asked questions

Is CVE-2021-22205 exploited in the wild?
Yes. As of Nov 7, 2026, Mallory has reports of exploitation in the wild, and CISA added it to KEV on Nov 3, 2021.
Is there a public exploit for CVE-2021-22205?
Yes. Mallory tracks 15 public exploits or proofs of concept for CVE-2021-22205, the earliest disclosed Apr 14, 2021.
Is there a patch for CVE-2021-22205?
Upgrade GitLab CE or EE to a currently supported, patched release. Historical releases addressing this vulnerability are 13.8.8, 13.9.6, and 13.10.3 for their respective branches.
What products are affected by CVE-2021-22205?
Gitlab.
How severe is CVE-2021-22205?
CVE-2021-22205 has a CVSS v3.1 score of 10.0 (Critical) and an EPSS score of 99.7% (100th percentile) as of Nov 7, 2026.
Activity feed

Recent activity

49 sources tracked across advisories, community write-ups, and news. New activity surfaces here as Mallory finds it.

View more in app →
+33 more in the timeline. Sign up to see them
Do you run this?See affected versions in your environment and whether adversaries are exploiting this vulnerability against assets like yours.
Check your exposure
Mallory platform

The version that knows your environment.

This page is what’s public. Mallory adds the parts that aren’t: which of your assets are affected, which adversaries are exploiting it right now, and which detections to deploy tonight.
Exposure mappingQuery your assets running an affected version, and investigate the blast radius.
Threat actor evidence15Every report linking this CVE to a named adversary.
Associated malware20Malware families linked to this CVE, with evidence and IOCs.
Detection signatures4YARA, Sigma, Snort, and vendor rules, auto-deployed to your SIEM.
Vendor-by-vendor mappingCross-references every affected SKU, including bundled OEM variants.
Social activity8Community discussion across Reddit, Mastodon, and other social sources.