ExifTool Remote Code Execution Vulnerability — Improper neutralization of user data in the DjVu file format in Exiftool versions 7.44 and up allows arbitrary code execution when parsing the malicious image
CVE-2021-22204 is a critical remote code execution vulnerability in ExifTool affecting versions 7.44 and later. Attackers can execute arbitrary code by crafting malicious DjVu image files, exploiting improper input validation. With a CVSS score of 9.0 and publicly available exploits, this vulnerability poses an immediate threat to organizations processing untrusted image files, particularly in document management and content analysis systems.
IMMEDIATE ACTIONS:
1. Identify all systems running ExifTool versions 7.44 through 12.23 using asset inventory and vulnerability scanning
2. Restrict file upload functionality to trusted sources only; implement strict file type validation
3. Disable DjVu file processing if not operationally required
4. Isolate affected systems from production networks if patching cannot be completed immediately
PATCHING:
1. Upgrade ExifTool to version 12.24 or later immediately
2. Verify patch installation: exiftool -ver should show version 12.24+
3. Test patched systems with known-safe image files before returning to production
COMPENSATING CONTROLS (if immediate patching unavailable):
1. Implement input validation: reject DjVu files (.djvu, .djv extensions) at application layer
2. Run ExifTool in sandboxed/containerized environment with minimal privileges
3. Process image files on isolated systems without network access
4. Monitor ExifTool process execution for suspicious child processes
DETECTION:
1. Monitor for ExifTool process spawning shell commands (cmd.exe, /bin/bash, powershell)
2. Alert on DjVu file uploads or processing attempts
3. Log all ExifTool execution with command-line arguments
4. Monitor for unexpected network connections from ExifTool processes
الإجراءات الفورية:
1. تحديد جميع الأنظمة التي تقوم بتشغيل ExifTool الإصدارات 7.44 إلى 12.23 باستخدام جرد الأصول والفحص الضعيف
2. تقييد وظيفة تحميل الملفات للمصادر الموثوقة فقط؛ تنفيذ التحقق الصارم من نوع الملف
3. تعطيل معالجة ملفات DjVu إذا لم تكن مطلوبة تشغيلياً
4. عزل الأنظمة المتأثرة عن شبكات الإنتاج إذا لم يتمكن من إكمال التصحيح فوراً
التصحيح:
1. ترقية ExifTool إلى الإصدار 12.24 أو أحدث فوراً
2. التحقق من تثبيت التصحيح: exiftool -ver يجب أن يظهر الإصدار 12.24+
3. اختبار الأنظمة المصححة بملفات صور آمنة معروفة قبل العودة إلى الإنتاج
الضوابط البديلة (إذا لم يكن التصحيح الفوري متاحاً):
1. تنفيذ التحقق من المدخلات: رفض ملفات DjVu على مستوى التطبيق
2. تشغيل ExifTool في بيئة معزولة/حاوية بامتيازات دنيا
3. معالجة ملفات الصور على أنظمة معزولة بدون وصول الشبكة
4. مراقبة تنفيذ عملية ExifTool للعمليات الفرعية المريبة
الكشف:
1. مراقبة عملية ExifTool التي تولد أوامر shell
2. تنبيه محاولات تحميل أو معالجة ملفات DjVu
3. تسجيل جميع عمليات تنفيذ ExifTool مع معاملات سطر الأوامر
4. مراقبة الاتصالات الشبكية غير المتوقعة من عمليات ExifTool