CVE-2026-144959: Masterminds html5-php before 2.12.0 Filter Bypass XSS via Invalid UTF-8 Removal
Masterminds html5-php before 2.12.0 contains a cross-site scripting vulnerability because UTF8Utils::convertToUTF8 deletes invalid UTF-8 bytes instead of replacing them with U+FFFD. Attackers can split tokens like <scr\xFFipt> with bytes such as 0xFF to evade raw-byte tag filters and inject script elements into rendered output.
Other sources
Masterminds html5-php before 2.12.0 contains a cross-site scripting vulnerability in OutputRules::namespaceAttrs, which writes xmlns: namespace declaration values into double-quoted attributes without escaping. Attackers can supply HTML with an xmlns:x value containing a double quote to bypass DOM-walking sanitizers and inject script into output re-serialized with saveHTML.
— OSV
Masterminds html5-php before 2.12.0 contains a denial of service vulnerability that allows remote attackers to exhaust CPU through quadratic parse-error position tracking in Tokenizer::parseError. Attackers can submit small HTML documents with repeated '&;' sequences that trigger full-buffer rescans in Scanner::currentLine and Scanner::columnOffset, consuming seconds of CPU per document.
— OSV
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 2.12.0
Event History
Frequently Asked Questions
Which deployments are exposed?
Applications using composer/masterminds/html5 versions before 2.12.0 are affected when they process attacker-controlled content and rely on raw-byte filtering intended to block HTML tags or script elements before rendering.
What does an attacker need to exploit this?
The attacker needs to provide input containing invalid UTF-8 bytes placed inside a token, such as splitting a script tag with 0xFF. The malformed bytes can evade a raw-byte tag filter and then be removed during UTF-8 conversion, allowing a script element to be produced in rendered output.
What version addresses the issue?
Version 2.12.0 is identified as the release containing the fix. Versions before 2.12.0 should be treated as affected.