CVE-2020-13756: Sabberworm/php css parser Sabberworm PHP CSS Parser Code Vulnerability
CRITICALCVE-2020-13756 is a CRITICAL (CVSS 9.8) sabberworm php css parser code vulnerability (CWE-94: Improper Control of Generation of Code ('Code Injection')) affecting Sabberworm/php css parser libraries in the Packagist ecosystem. The issue involves sabberworm php css parser code injection vulnerability in allselectors(). Remediation is available by upgrading affected packages to version 8.3.1, 8.2.1, 8.1.1, 8.0.1, 7.0.4, 6.0.2, 5.2.1, 5.1.3, 5.0.9, 4.0.1, 3.0.1, 2.0.1, 1.0.1.
CVE-2020-13756 at a Glance
Security Impact
CVSS: 9.8
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H).
How to Fix CVE-2020-13756
To remediate this vulnerability, upgrade all affected Sabberworm/php css parser dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade sabberworm/php-css-parser to 8.3.1
Upgrade sabberworm/php-css-parser to 8.2.1
Upgrade sabberworm/php-css-parser to 8.1.1
Upgrade sabberworm/php-css-parser to 8.0.1
Upgrade sabberworm/php-css-parser to 7.0.4
Upgrade sabberworm/php-css-parser to 6.0.2
Upgrade sabberworm/php-css-parser to 5.2.1
Upgrade sabberworm/php-css-parser to 5.1.3
Upgrade sabberworm/php-css-parser to 5.0.9
Upgrade sabberworm/php-css-parser to 4.0.1
Upgrade sabberworm/php-css-parser to 3.0.1
Upgrade sabberworm/php-css-parser to 2.0.1
Upgrade sabberworm/php-css-parser to 1.0.1
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for sabberworm/php-css-parser
How to Check if You Are Affected
To determine whether your application is affected by CVE-2020-13756, inspect your project dependencies for Sabberworm/php css parser:
inspect dependencies for sabberworm/php-css-parser
Analyze the terminal output to locate any version of Sabberworm/php css parser in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 8.3.1), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-94: Improper Control of Generation of Code ('Code Injection'), where the product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment. In Sabberworm/php css parser, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2020-13756 Affected Sabberworm/php css parser Versions
13 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
sabberworm/php-css-parser
|
Packagist |
≥ 8.3.0
< 8.3.1
|
8.3.1
|
|
sabberworm/php-css-parser
|
Packagist |
≥ 8.2.0
< 8.2.1
|
8.2.1
|
|
sabberworm/php-css-parser
|
Packagist |
≥ 8.1.0
< 8.1.1
|
8.1.1
|
|
sabberworm/php-css-parser
|
Packagist |
≥ 8.0.0
< 8.0.1
|
8.0.1
|
|
sabberworm/php-css-parser
|
Packagist |
≥ 7.0.0
< 7.0.4
|
7.0.4
|
|
sabberworm/php-css-parser
|
Packagist |
≥ 6.0.0
< 6.0.2
|
6.0.2
|
|
sabberworm/php-css-parser
|
Packagist |
≥ 5.2.0
< 5.2.1
|
5.2.1
|
|
sabberworm/php-css-parser
|
Packagist |
≥ 5.1.0
< 5.1.3
|
5.1.3
|
|
sabberworm/php-css-parser
|
Packagist |
≥ 5.0.0
< 5.0.9
|
5.0.9
|
|
sabberworm/php-css-parser
|
Packagist |
≥ 4.0.0
< 4.0.1
|
4.0.1
|
|
sabberworm/php-css-parser
|
Packagist |
≥ 3.0.0
< 3.0.1
|
3.0.1
|
|
sabberworm/php-css-parser
|
Packagist |
≥ 2.0.0
< 2.0.1
|
2.0.1
|
|
sabberworm/php-css-parser
|
Packagist |
≥ 1.0.0
< 1.0.1
|
1.0.1
|
References
Frequently Asked Questions
What is CVE-2020-13756?
Which Sabberworm/php css parser versions are affected?
What version fixes CVE-2020-13756?
Is sabberworm/php-css-parser affected?
What is the CVSS score of CVE-2020-13756?
What CWE is associated with CVE-2020-13756?
How can I check Packagist dependencies for CVE-2020-13756?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-phrq-v4q2-hmq6",
"modified" : "2025-11-03T21:51:16Z",
"published" : "2022-03-26T00:15:22Z",
"aliases" : [ "CVE-2020-13756" ],
"summary" : "Sabberworm PHP CSS Parser Code injection vulnerability in allSelectors()",
"details" : "Sabberworm PHP CSS Parser before 8.3.1 calls eval on uncontrolled data, possibly leading to remote code execution if the function allSelectors() or getSelectorsBySpecificity() is called with input from an attacker.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Packagist",
"name" : "sabberworm/php-css-parser"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "8.3.0"
}, {
"fixed" : "8.3.1"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Packagist",
"name" : "sabberworm/php-css-parser"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "8.2.0"
}, {
"fixed" : "8.2.1"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Packagist",
"name" : "sabberworm/php-css-parser"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "8.1.0"
}, {
"fixed" : "8.1.1"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Packagist",
"name" : "sabberworm/php-css-parser"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "8.0.0"
}, {
"fixed" : "8.0.1"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Packagist",
"name" : "sabberworm/php-css-parser"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "7.0.0"
}, {
"fixed" : "7.0.4"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Packagist",
"name" : "sabberworm/php-css-parser"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "6.0.0"
}, {
"fixed" : "6.0.2"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Packagist",
"name" : "sabberworm/php-css-parser"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "5.2.0"
}, {
"fixed" : "5.2.1"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Packagist",
"name" : "sabberworm/php-css-parser"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "5.1.0"
}, {
"fixed" : "5.1.3"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Packagist",
"name" : "sabberworm/php-css-parser"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "5.0.0"
}, {
"fixed" : "5.0.9"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Packagist",
"name" : "sabberworm/php-css-parser"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "4.0.0"
}, {
"fixed" : "4.0.1"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Packagist",
"name" : "sabberworm/php-css-parser"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "3.0.0"
}, {
"fixed" : "3.0.1"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Packagist",
"name" : "sabberworm/php-css-parser"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "2.0.0"
}, {
"fixed" : "2.0.1"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Packagist",
"name" : "sabberworm/php-css-parser"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "1.0.0"
}, {
"fixed" : "1.0.1"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2020-13756"
}, {
"type" : "WEB",
"url" : "https://github.com/sabberworm/PHP-CSS-Parser/commit/2ebf59e8bfbf6cfc1653a5f0ed743b95062c62a4"
}, {
"type" : "WEB",
"url" : "https://github.com/FriendsOfPHP/security-advisories/blob/master/sabberworm/php-css-parser/CVE-2020-13756.yaml"
}, {
"type" : "WEB",
"url" : "https://github.com/sabberworm/PHP-CSS-Parser/releases/tag/8.3.1"
}, {
"type" : "WEB",
"url" : "https://lists.debian.org/debian-lts-announce/2025/10/msg00013.html"
}, {
"type" : "WEB",
"url" : "https://packetstormsecurity.com/files/cve/CVE-2020-13756"
}, {
"type" : "WEB",
"url" : "http://packetstormsecurity.com/files/157923/Sabberworm-PHP-CSS-Code-Injection.html"
}, {
"type" : "WEB",
"url" : "http://seclists.org/fulldisclosure/2020/Jun/7"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-20", "CWE-94" ],
"severity" : "CRITICAL",
"github_reviewed" : true,
"github_reviewed_at" : "2022-03-26T00:15:22Z",
"nvd_published_at" : "2020-06-03T14:15:12Z"
}
}