dotCMS Unrestricted Upload of File Vulnerability — dotCMS ContentResource API contains an unrestricted upload of file with a dangerous type vulnerability that allows for directory traversal, in which the file is saved outside of the intended storage location. Exploitation allows for remote code execution.
CVE-2022-26352 is a critical remote code execution vulnerability in dotCMS ContentResource API allowing unrestricted file uploads with directory traversal capabilities. Attackers can upload malicious files outside intended directories, achieving arbitrary code execution on affected systems. With a CVSS score of 9.0 and publicly available exploits, this poses an immediate threat to organizations using vulnerable dotCMS versions.
IMMEDIATE ACTIONS:
1. Identify all dotCMS instances in your environment and document versions
2. Disable or restrict access to ContentResource API endpoints immediately using WAF rules or network segmentation
3. Implement IP whitelisting for API access if the service must remain operational
4. Monitor for suspicious file upload attempts and directory traversal patterns
PATCHING:
1. Apply the latest dotCMS security patch immediately (version 5.3.8 or later for 5.x branch, 21.06 or later for 21.x branch)
2. Test patches in non-production environments before deployment
3. Prioritize patching for internet-facing instances
COMPENSATING CONTROLS (if patching delayed):
1. Deploy WAF rules to block requests containing directory traversal sequences (../, ..\, %2e%2e)
2. Implement strict file upload validation: whitelist allowed file extensions, enforce file type verification
3. Configure file upload directory with no execute permissions
4. Restrict ContentResource API to authenticated users only
5. Enable detailed logging of all API requests and file operations
DETECTION:
1. Monitor for POST requests to /api/v1/contentresource endpoints
2. Alert on file uploads containing path traversal characters
3. Track creation of executable files (.jsp, .jspx, .war) in unexpected directories
4. Monitor process execution from web application directories
الإجراءات الفورية:
1. حدد جميع نسخ dotCMS في بيئتك وقثق الإصدارات
2. عطّل أو قيّد الوصول إلى نقاط نهاية ContentResource API فوراً باستخدام قواعد WAF أو تقسيم الشبكة
3. طبّق قائمة بيضاء للعناوين IP للوصول إلى API إذا كان يجب أن تبقى الخدمة تعمل
4. راقب محاولات رفع الملفات المريبة وأنماط اجتياز المجلدات
التصحيح:
1. طبّق أحدث تصحيح أمان dotCMS فوراً (الإصدار 5.3.8 أو أحدث للفرع 5.x، 21.06 أو أحدث للفرع 21.x)
2. اختبر التصحيحات في بيئات غير الإنتاج قبل النشر
3. أولوية التصحيح للنسخ المتصلة بالإنترنت
الضوابط البديلة (إذا تأخر التصحيح):
1. نشّر قواعد WAF لحجب الطلبات التي تحتوي على تسلسلات اجتياز المجلدات
2. طبّق التحقق الصارم من رفع الملفات: قائمة بيضاء بامتدادات الملفات المسموحة
3. كوّن مجلد رفع الملفات بدون أذونات التنفيذ
4. قيّد ContentResource API للمستخدمين المصرح لهم فقط
5. فعّل تسجيل مفصل لجميع طلبات API وعمليات الملفات
الكشف:
1. راقب طلبات POST إلى نقاط نهاية /api/v1/contentresource
2. أصدر تنبيهات عند رفع الملفات التي تحتوي على أحرف اجتياز المسارات
3. تتبع إنشاء الملفات القابلة للتنفيذ في المجلدات غير المتوقعة
4. راقب تنفيذ العمليات من مجلدات تطبيق الويب