CVE-2026-144957: Masterminds html5-php before 2.12.0 CPU Exhaustion via Parse-Error Position Tracking
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.
— MITRE
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 to remote exploitation?
Deployments that use the affected library to parse attacker-controlled HTML are exposed. An unauthenticated remote attacker can submit crafted input, so no privileges or user interaction are required.
What input triggers the CPU exhaustion?
Small HTML documents containing repeated "&;" sequences can trigger parse errors that cause full-buffer rescans for line and column tracking. The resulting quadratic processing can consume seconds of CPU for a single document.
Are confidentiality or integrity affected?
The provided severity vector indicates availability impact only. It lists no confidentiality or integrity impact.
What version addresses the issue?
Version 2.12.0 is the stated fixed release. Versions before 2.12.0 are affected.