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.
Published: 2026-08-06
Score: 8.2 High
EPSS: n/a
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

The vulnerability is caused by an inefficient algorithmic loop in the html_sanitize_ex Traverser that performs a flatten operation on every sibling element during traversal. This results in quadratic time and space complexity, allowing an attacker to supply a flat list of sibling nodes that triggers excessive CPU and memory consumption. The impact is a server‑level denial of service, as the sanitizer runs until the process is killed or resources are exhausted. The weakness is identified as CWE‑407: Excessive Calculation.

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 is not available, so the exact exploitation probability cannot be estimated, but the flaw can be exploited from the network without authentication and only requires sending a crafted HTML body. Because the HTML sanitizer is part of every public input endpoint, deployment of the vulnerable library effectively exposes the entire application to CPU‐exhaustion attacks. The vulnerability is not currently listed in the CISA KEV catalog, but its impact warrants prompt remediation.

Generated by OpenCVE AI on August 6, 2026 at 16:42 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 6, 2026 at 16:42 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

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
cve-icon MITRE

Status: PUBLISHED

Assigner: EEF

Published:

Updated: 2026-08-06T14:50:20.284Z

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

Link: CVE-2026-68750

cve-icon Vulnrichment

No data.

cve-icon NVD

No data.

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-08-06T16:45:07Z

Weaknesses
  • CWE-407

    Inefficient Algorithmic Complexity