Description
Inefficient Algorithmic Complexity vulnerability in the traversal engine in rrrene html_sanitize_ex 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 html_sanitize_ex: from 0.3.1 before 1.4.5 and from 1.5.0-rc.0 before 1.5.3.
Published: 2026-08-06
Score: 8.2 High
EPSS: < 1% Very Low
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

The html_sanitize_ex traversal engine suffers from an inefficient algorithm that executes in quadratic time with respect to the number of sibling elements in a flat list. The traverser’s implementation recurses on the tail of the sibling list and then applies List.flatten([head] ++ tail) to the accumulated result, causing each of the n siblings to copy and traverse the remaining tail. Because this cost is paid for every node, the overall traversal becomes O(n²). An attacker can exploit this by sending a crafted HTML payload containing many allowed tags as sibling elements; the payload does not require any special configuration or authentication, as the sanitizer is invoked on every public entry point. A 160‑KB body with 20,000 sibling elements can saturate the scheduler for roughly 1.7 seconds, and the cost grows faster than the body size. This issue is designated CWE‑407.

Affected Systems

The flaw exists in the rrrene html_sanitize_ex library versions up to and including 1.5.2. Any system that incorporates these versions and invokes the sanitizer via a public entry point is affected; a user can trigger the issue regardless of authentication status or special configuration, simply by sending a payload that contains many sibling elements and allowed tags.

Risk and Exploitability

The CVSS score of 8.2 classifies this issue as high severity. The EPSS score of < 1% indicates a very low but non-zero probability of exploitation. This vulnerability is exploitable from the network without authentication and simply requires sending a crafted HTML body that contains many sibling elements and allowed tags. Because the HTML sanitizer is part of every public input endpoint, an application that includes a vulnerable version of html_sanitize_ex effectively exposes the entire system to CPU‑exhaustion attacks. The vulnerability is not listed in the CISA KEV catalog, but its impact warrants prompt remediation.

Generated by OpenCVE AI on August 22, 2026 at 10:24 UTC.

Remediation

Vendor Workaround

Cap the size of user-supplied HTML, and in particular the node count, before it reaches the sanitizer. The quadratic growth means the cap has to be small to be effective.


OpenCVE Recommended Actions

  • Upgrade the html_sanitize_ex library to version 1.5.3 or later when a patch is available.
  • If an upgrade cannot be performed immediately, limit the size of user‑supplied HTML input, particularly the node count, before it reaches the sanitizer to prevent quadratic growth from exhausting resources.
  • Implement application‑level validation that rejects HTML payloads exceeding a defined size threshold; consider rate limiting or throttling requests that approach the limit.

Generated by OpenCVE AI on August 22, 2026 at 10:24 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

Wed, 19 Aug 2026 12:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'partial'}, 'version': '2.0.3'}


Wed, 19 Aug 2026 12:00:00 +0000

Type Values Removed Values Added
Description Inefficient Algorithmic Complexity vulnerability in the traversal engine in rrrene html_sanitize_ex 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 html_sanitize_ex: from 0.3.1 before 1.5.3. Inefficient Algorithmic Complexity vulnerability in the traversal engine in rrrene html_sanitize_ex 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 html_sanitize_ex: from 0.3.1 before 1.4.5 and from 1.5.0-rc.0 before 1.5.3.
References

Tue, 11 Aug 2026 16:00:00 +0000

Type Values Removed Values Added
First Time appeared Rrrene htmlsanitizeex
CPEs cpe:2.3:a:rrrene:htmlsanitizeex:*:*:*:*:*:*:*:*
Vendors & Products Rrrene htmlsanitizeex
Metrics cvssV3_1

{'score': 7.5, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H'}


Thu, 06 Aug 2026 15:30:00 +0000

Type Values Removed Values Added
Description Inefficient Algorithmic Complexity vulnerability in the traversal engine in rrrene html_sanitize_ex 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 html_sanitize_ex: from 0.3.1 before 1.5.3.
Title Quadratic sibling re-flattening in the html_sanitize_ex traversal engine allows CPU-exhaustion denial of service
First Time appeared Rrrene
Rrrene html Sanitize Ex
Weaknesses CWE-407
CPEs cpe:2.3:a:rrrene:html_sanitize_ex:*:*:*:*:*:*:*:*
Vendors & Products Rrrene
Rrrene html Sanitize Ex
References
Metrics cvssV4_0

{'score': 8.2, 'vector': 'CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N'}


Subscriptions

Rrrene Html Sanitize Ex Htmlsanitizeex
cve-icon MITRE

Status: PUBLISHED

Assigner: EEF

Published:

Updated: 2026-08-19T11:47:34.685Z

Reserved: 2026-07-31T13:23:00.355Z

Link: CVE-2026-68750

cve-icon Vulnrichment

Updated: 2026-08-06T15:41:24.466Z

cve-icon NVD

Status : Modified

Published: 2026-08-06T16:16:51.907

Modified: 2026-08-19T12:18:35.400

Link: CVE-2026-68750

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-08-22T10:30:17Z

Weaknesses
  • CWE-407

    Inefficient Algorithmic Complexity