CVE-2026-68750: Quadratic sibling re-flattening in the html_sanitize_ex traversal engine allows CPU-exhaustion denial of service
Inefficient Algorithmic Complexity vulnerability in the traversal engine in rrrene htmlsanitizeex allows an unauthenticated remote attacker to exhaust server CPU and memory via a flat run of sibling elements in sanitized HTML. The list clause of HtmlSanitizeEx.Traverser.traverse/2 recurses on the tail of a sibling list and then evaluates List.flatten([head] ++ tail) over the already flattened result, so every one of n siblings copies and re-walks the entire remaining tail. The flattening is only needed for the rare case where scrub returns several replacement nodes for one node, but the cost is paid across the whole tail at every step, making traversal quadratic in sibling count.
The traverser sits on every public entry point, so no particular scrubber or configuration is required and the payload needs only allowed tags. A 160 KB body of 20,000 sibling elements occupies a scheduler for roughly 1.7 seconds, and the cost grows faster than the body does.
This issue affects htmlsanitizeex: from 0.3.1 before 1.5.3.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
rrrene html_sanitize_exto a version that resolves this vulnerability.Fixed in 1.5.3 - Compensating control
To reduce risk while upgrading, limit exposure of public entry points that use HtmlSanitizeEx.Traverser.traverse/2 (e.g., apply rate limiting and request size limits on endpoints that accept user-supplied sanitized HTML) to make sibling-list CPU/memory exhaustion less feasible.
Event History
Frequently Asked Questions
What is the severity of CVE-2026-68750?
CVE-2026-68750 has a risk score of 45, indicating a moderate level of impact.
How do I fix CVE-2026-68750?
To fix CVE-2026-68750, update to the latest version of the html_sanitize_ex library that addresses this vulnerability.
What does CVE-2026-68750 affect?
CVE-2026-68750 affects the traversal engine in the html_sanitize_ex library.
What type of attack does CVE-2026-68750 allow?
CVE-2026-68750 allows an unauthenticated remote attacker to launch a CPU-exhaustion denial of service attack.
What is the exploit method for CVE-2026-68750?
The exploit method for CVE-2026-68750 involves sending specially crafted sanitized HTML with a flat run of sibling elements.