Impact
justhtml versions before 1.17.0 contain multiple flaws in how the library sanitizes and serializes markup. Custom policies that preserve foreign namespaces such as SVG’s <foreignObject> or MathML’s <annotation‑xml encoding="text/html"> allow dangerous content to bypass the sanitizer, survive a reparse, and become active HTML. The library also serializes script, style, and comment nodes into active markup, and additional hardening fixes address issues that could lead to infinite loops. These weaknesses, classified as CWE‑79, enable attackers to inject executable code into a page that uses justhtml for rendering user input.
Affected Systems
The vulnerability affects all versions of justhtml prior to 1.17.0 released by EmilStenstrom. The default usage path JustHTML(..., sanitize=True) is intended to be safe, while advanced or custom configurations are more likely to be affected.
Risk and Exploitability
The CVSS score is 5.1, indicating moderate severity. EPSS data is not available, and the vulnerability is not listed in the CISA KEV catalog, suggesting the risk of known exploitation is currently uncertain. Nonetheless, the impact can be significant if an attacker injects malicious content and the application consumes it under a custom policy that preserves foreign namespaces. The attack vector is primarily through crafted input that the application processes with justhtml. Reducing or removing those custom policy features mitigates the risk.
OpenCVE Enrichment