CVE-2020-13756
📋 TL;DR
CVE-2020-13756 is a critical remote code execution vulnerability in Sabberworm PHP CSS Parser where the eval() function processes uncontrolled user input. This allows attackers to execute arbitrary PHP code on systems using vulnerable versions. Any PHP application that uses this library to parse CSS from untrusted sources is affected.
💻 Affected Systems
- Sabberworm PHP CSS Parser
📦 What is this software?
Php Css Parser by Sabberworm
⚠️ Risk & Real-World Impact
Worst Case
Complete system compromise with attacker gaining full control over the web server, allowing data theft, malware installation, and lateral movement.
Likely Case
Remote code execution leading to web application compromise, data exfiltration, and potential pivot to internal systems.
If Mitigated
Limited impact if input validation prevents malicious CSS from reaching the vulnerable functions.
🎯 Exploit Status
Proof-of-concept exploit code is publicly available. Exploitation requires the vulnerable functions to be called with malicious CSS input.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: 8.3.1
Vendor Advisory: https://github.com/sabberworm/PHP-CSS-Parser/releases/tag/8.3.1
Restart Required: No
Instructions:
1. Update Sabberworm PHP CSS Parser to version 8.3.1 or later using composer: composer require sabberworm/php-css-parser:^8.3.1
2. Verify the update completed successfully
3. Test application functionality with the updated library
🔧 Temporary Workarounds
Input Validation
allImplement strict input validation to prevent malicious CSS from reaching the vulnerable parser functions.
Function Restriction
allAvoid calling allSelectors() or getSelectorsBySpecificity() with user-controlled CSS data.
🧯 If You Can't Patch
- Implement WAF rules to block CSS containing PHP code patterns
- Isolate the vulnerable application in a restricted network segment
🔍 How to Verify
Check if Vulnerable:
Check composer.json or the library files for version information. If version is below 8.3.1, the system is vulnerable.
Check Version:
composer show sabberworm/php-css-parser | grep versions
Verify Fix Applied:
Verify the installed version is 8.3.1 or higher using composer show sabberworm/php-css-parser
📡 Detection & Monitoring
Log Indicators:
- Unusual PHP eval() errors in application logs
- Suspicious CSS parsing activity
- Unexpected PHP process execution
Network Indicators:
- HTTP requests containing PHP code in CSS parameters
- Outbound connections from web server to unknown destinations
SIEM Query:
source="web_logs" AND ("allSelectors" OR "getSelectorsBySpecificity") AND ("eval" OR "php://" OR "system(")
🔗 References
- http://packetstormsecurity.com/files/157923/Sabberworm-PHP-CSS-Code-Injection.html
- http://seclists.org/fulldisclosure/2020/Jun/7
- https://github.com/sabberworm/PHP-CSS-Parser/commit/2ebf59e8bfbf6cfc1653a5f0ed743b95062c62a4
- https://github.com/sabberworm/PHP-CSS-Parser/releases/tag/8.3.1
- http://packetstormsecurity.com/files/157923/Sabberworm-PHP-CSS-Code-Injection.html
- http://seclists.org/fulldisclosure/2020/Jun/7
- https://github.com/sabberworm/PHP-CSS-Parser/commit/2ebf59e8bfbf6cfc1653a5f0ed743b95062c62a4
- https://github.com/sabberworm/PHP-CSS-Parser/releases/tag/8.3.1
- https://lists.debian.org/debian-lts-announce/2025/10/msg00013.html