CVE DatabaseCVE-2021-22204
한국어 권고문 →
CVE-2021-222047.8/HIGHCISA KEVCWE-94CWE-94

ExifTool DjVu File Parsing Arbitrary Code Execution Vulnerability (CVE-2021-22204) Security Advisory

⚡ Jump to Patch
Affected Vendors
exiftool, gitlab
Affected Components
exiftool, gitlab_enterprise_edition, gitlab_community_edition
Published Date
2021-04-23
CVSS v3.1
7.8
HIGH
EPSS (30d)
100.0%
FIRST.org
CISA KEV
Exploited

Executive & SecOps Summary

SECOPS ASSESSMENT
Affected Scope

ExifTool versions 7.44 up to 12.24, and third-party integrations such as GitLab that utilize ExifTool for metadata parsing

Impact

Unauthenticated remote attackers can execute arbitrary commands on the host system by uploading a specially crafted DjVu image

Mitigation

Immediately upgrade ExifTool to version 12.24 or higher, and update GitLab instances to 13.10.3, 13.9.6, 13.8.8, or newer

Affected Products & Version Scope

ExifTool versions 7.44 through 12.23, and GitLab versions 11.9.0 through 13.10.2

Remediation & Live Workaround Commands

PATCH & WORKAROUND

1. Official Patch & Version Upgrade Commands

Upgrade ExifTool to the latest patched version (12.24+) or update your GitLab instance immediately using the package manager.

bash
# Upgrade ExifTool on Debian/Ubuntu systems
sudo apt-get update && sudo apt-get install --only-upgrade libimage-exiftool-perl -y

# Upgrade GitLab Omnibus package to the latest secure version
sudo apt-get update && sudo apt-get install --only-upgrade gitlab-ee -y

2. Temporary Workaround & Hardening Configuration

If patching cannot be applied immediately, block DjVu file uploads at the reverse proxy or Web Application Firewall (WAF).

nginx
# Block access to DjVu files in Nginx configuration
# Add this block inside your server configuration
location ~* \.(djvu|djv)$ {
    deny all;
    access_log off;
    log_not_found off;
}

3. Log Audit & IoC Verification Commands

Verify the installed ExifTool version and scan uploaded files for potential Perl injection payloads.

bash
# Check the current ExifTool version
exiftool -ver

# Scan uploaded directories for suspicious Perl execution patterns in files
find /var/opt/gitlab/gitlab-rails/uploads/ -type f -exec grep -l 'eval' {} \;
Interactive SecOps Remediation Checklist
0/4 (0%)
Recommended Security Control & Mitigation Partner
Snyk Open Source & Container Security
Immediately apply the latest security updates to ExifTool and GitLab to mitigate active exploitation risks.

Scan Your Repositories for Transitive Vulnerable Dependencies in 30 Seconds

Automatically detect vulnerable packages across npm, PyPI, Maven, and Go, and open automated fix Pull Requests without breaking your build.

Free Forever Tier · 1-Click GitHub/GitLab Auto-PR
Master DevSecOps: Automated SAST/SCA in GitHub Actions & Kubernetes
View Course Curriculum

Technical Root Cause & Exploitation Mechanics

1. Vulnerability Overview & Root Cause

This vulnerability (CVE-2021-22204) is an arbitrary code execution flaw in ExifTool, a widely used open-source library for reading and writing image/document metadata. The root cause lies in the improper neutralization of user-supplied data within the DjVu file format parser. Specifically, when processing the metadata inside the DjVu ANT (Annotation) chunk, ExifTool fails to properly sanitize input before passing it to a Perl 'eval'-like statement, allowing arbitrary Perl code execution.

2. Exploitation Mechanics & Attack Scenario

An attacker crafts a malicious DjVu file containing payload-carrying Perl code inside the metadata annotation block. When ExifTool parses this file, the parser attempts to handle double-quoted strings but fails to correctly escape control characters. This allows the attacker to break out of the string context and inject arbitrary Perl syntax. In a real-world scenario, such as in GitLab, this vulnerability was chained with unauthenticated file upload endpoints, allowing remote attackers to achieve full Remote Code Execution (RCE) without any credentials.

3. Infrastructure & Business Impact

Given its inclusion in the CISA KEV list and an EPSS score of 0.9998, this vulnerability has been heavily exploited in the wild. Compromising developer infrastructure like GitLab can lead to catastrophic supply chain attacks, source code theft, lateral movement within internal networks, and deployment of ransomware, posing an existential threat to enterprise operations.

Official Vendor Advisories & References

Frequently Asked SecOps Questions (CVE-2021-22204)

FAQ

Q1. How critical is CVE-2021-22204 and is it actively exploited in the wild?

CVE-2021-22204 is rated CVSS 7.8 (HIGH) with a 30-day EPSS exploitation probability of 100.0%. It is listed in the CISA Known Exploited Vulnerabilities (KEV) catalog, requiring immediate emergency remediation.

Q2. Which vendors and products are affected by CVE-2021-22204?

Primary impacted vendors include exiftool, gitlab across exiftool, gitlab_enterprise_edition, gitlab_community_edition. Scope summary: ExifTool versions 7.44 through 12.23, and GitLab versions 11.9.0 through 13.10.2

Q3. What temporary mitigations or workarounds exist for CVE-2021-22204 before patching?

[Mitigation] Immediately upgrade ExifTool to version 12.24 or higher, and update GitLab instances to 13.10.3, 13.9.6, 13.8.8, or newer Follow the CLI remediation commands and interactive SecOps checklist on this page to restrict exposure prior to your maintenance window.

SECOPS WORKBENCH INTEGRATION

Generate an Internal Engineering Notice or CISO Report for CVE-2021-22204

Instantly format this advisory into an executive CISO summary or engineering patch ticket.

Generate Report →

🔗 Related Advisories in Similar Stack (exiftool)

View Category →
SecOps Advisory Dispatch & RSS Feed

Subscribe to Daily Vulnerability Briefings & KEV Alerts

Concise morning briefings for SecOps, DevSecOps, and SRE teams covering newly exploited CVEs and mitigation priorities.

Slack / Teams / RSS Feed:
PatchKO
CVE-2021-22204 ExifTool DjVu File Parsing Arbitrary Code Execution Vulnerability (CVE-2021-22204) Security Advisory (CVSS 7.8) - Patch & Workaround | CVE Pulse