html_sanitize_ex is vulnerable to Regular Expression Denial of Service (ReDoS)
82
CVE Score
High
Regular Expression Denial of Service (ReDoS)
The CSS scrubber matches a declaration's property name with an unbounded pattern followed by a mandatory colon, so a long run of word characters not followed by a colon forces the regex engine to backtrack one character at a time and retry from every offset. The work grows quadratically with the length of the run, and no length cap is applied to the CSS handed to the scrubber. Sanitizing a large style value therefore consumes seconds of scheduler time and can saturate the scheduler pool, making the application unresponsive. The fix bounds the matching so long non-declaration input no longer triggers quadratic backtracking.
Upgrade the html_sanitize_ex library to the patch version.
You are affected if you are using a version that falls within the vulnerable range and you sanitize content that reaches the CSS scrubber.
0.3.1 - 1.5.2
Fixed in 1.5.3html_sanitize_ex is vulnerable to Regular Expression Denial of Service (ReDoS) in versions 0.3.1 - 1.5.2.
Secure your code, cloud, and runtime in one central system. Connect a repo to discover what the reasoning agents find in your codebase.
No credit card required | Scan results in 32 seconds.
I consent to receiving marketing communications based on Aikido’s Privacy Policy.
SOC 2Compliant
ISO 27001Compliant
ISO 42001Compliant© All Intel data is openly available and commercially licensed.