CVE-2021-44978
📋 TL;DR
This CVE describes a server-side template injection (SSTI) vulnerability in iCMS that allows authenticated users to add and render custom templates, leading to remote code execution. The vulnerability affects iCMS versions up to and including 8.0.0. Attackers with user-level access can exploit this to execute arbitrary code on the server.
💻 Affected Systems
- iCMS
📦 What is this software?
Icms by Idreamsoft
⚠️ Risk & Real-World Impact
Worst Case
Full system compromise allowing attackers to execute arbitrary commands, steal data, install malware, or pivot to other systems.
Likely Case
Unauthorized code execution leading to data theft, website defacement, or deployment of web shells for persistent access.
If Mitigated
Limited impact if proper input validation and template sandboxing are implemented, though risk remains for authenticated users.
🎯 Exploit Status
Exploitation requires authenticated access but is straightforward once access is obtained.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: > 8.0.0
Vendor Advisory: https://www.icmsdev.com/
Restart Required: No
Instructions:
1. Upgrade iCMS to version newer than 8.0.0. 2. Apply any available security patches from the vendor. 3. Test the upgrade in a staging environment first.
🔧 Temporary Workarounds
Disable custom template functionality
allTemporarily disable the ability for users to add or render custom templates.
Modify iCMS configuration to restrict template management to administrators only
Implement input validation
allAdd strict input validation and sanitization for template content.
Implement template sandboxing and whitelist allowed template functions
🧯 If You Can't Patch
- Restrict user permissions to prevent template management
- Implement web application firewall rules to detect and block SSTI patterns
🔍 How to Verify
Check if Vulnerable:
Check iCMS version in admin panel or configuration files. If version is 8.0.0 or earlier, system is vulnerable.
Check Version:
Check iCMS configuration files or admin panel for version information
Verify Fix Applied:
Verify iCMS version is greater than 8.0.0 and test template functionality with malicious input.
📡 Detection & Monitoring
Log Indicators:
- Unusual template file uploads
- Suspicious template rendering requests
- Commands executed via template functions
Network Indicators:
- HTTP requests containing template injection payloads
- Unusual outbound connections from web server
SIEM Query:
web_requests WHERE (url CONTAINS 'template' OR url CONTAINS 'render') AND (payload CONTAINS '{{' OR payload CONTAINS '{%')
🔗 References
- https://gem-love.com/2021/12/10/ICMS-8-0-0%E5%90%8E%E5%8F%B0%E6%A8%A1%E6%9D%BF%E6%B3%A8%E5%85%A5%E5%AF%BC%E8%87%B4%E8%BF%9C%E7%A8%8B%E4%BB%A3%E7%A0%81%E6%89%A7%E8%A1%8C0day%E6%BC%8F%E6%B4%9E%E5%88%86%E6%9E%90/
- https://www.icmsdev.com/
- https://gem-love.com/2021/12/10/ICMS-8-0-0%E5%90%8E%E5%8F%B0%E6%A8%A1%E6%9D%BF%E6%B3%A8%E5%85%A5%E5%AF%BC%E8%87%B4%E8%BF%9C%E7%A8%8B%E4%BB%A3%E7%A0%81%E6%89%A7%E8%A1%8C0day%E6%BC%8F%E6%B4%9E%E5%88%86%E6%9E%90/
- https://www.icmsdev.com/