Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessCraft malicious HTML/SVG for vulnerable config
-
DeliverySubmit to app using custom or programmatic sanitization
-
ExploitBypass sanitizer (mixed-case tag or SVG animation/url)
-
ExecutionStore or reflect active content
-
PersistVictim renders sanitized output
-
ImpactScript executes in victim browser session
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V2 - Validation and Business Logic Input validation, allowlisting
|
| Exploitation Conditions | Exploitation is not against the default configuration: the specific prerequisites are (1) use of a custom policy that preserves SVG or MathML foreign namespaces, enabling animation elements (<set>, <animate>), presentation attributes (fill, clip-path, mask, marker-start, cursor) with external url(...) references, or DOM trees mislabeled namespace="html"; (2) passing programmatic DOM to sanitize()/sanitize_dom(), which can miss mixed-case tags (ScRiPt, StYlE) or drop_content_tags sets like {"SCRIPT"}; (3) code that mutates or reuses sanitization policy objects, including exported defaults (DEFAULT_POLICY, DEFAULT_DOCUMENT_POLICY), leaving stale compiled sanitizers active - this one CAN affect the otherwise-default path; or (4) custom policies preserving style/script (remote @import) or crafted programmatic doctype names. Limiting factors: the ordinary JustHTML(..., sanitize=True) path on parsed HTML is largely unaffected; XSS payloads still require a victim to render the mis-sanitized output; and most vectors require the application to have opted into advanced/custom sanitization configurations. |
| Impact | The input CVSS 4.0 vector (AV:N/AC:L/PR:N/UI:N, VC:H/VI:H/VA:H, score 9.3) reads as trivially remote and unauthenticated with high impact, but this overstates real-world risk for the typical integrator: the description and vendor GHSA state most bypasses do NOT affect the default JustHTML(..., sanitize=True) path and instead require advanced usage - programmatic DOM input, custom SVG/MathML-preserving policies, or code that mutates reused/exported policy objects. That is a meaningful mismatch: AC:L/PR:N/UI:N implies default-config, no-interaction exploitation, whereas the actual conditions are configuration-dependent and, for XSS, ultimately require a victim to view the mis-sanitized content. The genuinely default-affecting subset is the policy-mutation issue (mutating DEFAULT_POLICY/DEFAULT_DOCUMENT_POLICY or nested state process-wide). There is no EPSS score provided, no KEV listing, and no POC referenced, so exploitation is not confirmed in any form; the reporting is credible (VulnCheck) and a fix exists. Net: treat as a real but moderate priority driven by whether your deployment uses the advanced paths - upgrade promptly if you sanitize programmatic DOM, use custom foreign-namespace policies, or reuse/mutate policy objects; lower urgency if you use only the default parsed-HTML sanitization path. |
| Exploit ScenarioDerived | An application uses justhtml <= 1.15.0 with a custom policy that preserves inline SVG for user-submitted content; an attacker submits SVG containing an <animate> element or a presentation attribute with an external url(...) reference that survives sanitization, and when another user views the page the active content executes in their browser session. Alternatively, an app feeding programmatic DOM to sanitize() is bypassed by a mixed-case <ScRiPt> node. No public POC is referenced in the source data. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Aug 23, 2026
Cross-site scripting via HTML sanitization bypass affects justhtml (a Python HTML parsing/sanitization library by EmilStenstrom) in all versions up to and including 1.15.0, letting active content such as script or style survive sanitization. The flaws mostly hit advanced usage - programmatic DOM input, reused or mutated policy objects, and custom policies that preserve SVG/MathML - rather than the default JustHTML(..., sanitize=True) path, though process-wide mutation of exported default policies can weaken sanitization broadly. Reported by VulnCheck and fixed in 1.16.0; no public exploit identified at time of analysis and it is not listed in CISA KEV.
RemediationAI
Vendor-released patch: upgrade to justhtml 1.16.0 (released April 12, 2026), which fixes all of the sanitization, serialization, and programmatic-DOM issues; this is the primary and complete remediation (advisory: https://github.com/EmilStenstrom/justhtml/security/advisories/GHSA-4p64-v8f5-r2gx). If you cannot upgrade immediately, apply the vendor's specific compensating controls: do not mutate DEFAULT_POLICY, DEFAULT_DOCUMENT_POLICY, or nested policy internals (prevents process-wide weakening but requires auditing your code paths); avoid reusing policy objects after mutating nested state (construct fresh policies per use, at a small performance cost); avoid preserving SVG or MathML for untrusted input (disables those namespaces, which breaks legitimate inline SVG/MathML rendering if you rely on it); and avoid preserving style or script in custom policies. Also route untrusted content only through the default JustHTML(..., sanitize=True) parsed-HTML path rather than programmatic sanitize()/sanitize_dom() DOM input where feasible.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in pypi
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
justhtml is a Python library that parses and sanitizes untrusted HTML, intended to strip active/dangerous markup before rendering. The root cause maps to CWE-20 (Improper Input Validation): sanitization logic fails to normalize or fully validate several input paths. Specifically, mixed-case tag names (ScRiPt, StYlE) slip through programmatic sanitize()/sanitize_dom() and drop_content_tags matching; crafted programmatic doctype names serialize into active markup; reused/mutated policy objects leave stale compiled sanitizers active; and custom policies preserving foreign namespaces (SVG/MathML) permit animation elements (<set>, <animate>) that mutate already-sanitized attributes, presentation attributes (fill, clip-path, mask, marker-start, cursor) carrying external url(...) references, and DOM trees mislabeled namespace="html" that serialize as <svg>/<math> to bypass foreign-content checks. The affected package is cpe:2.3:a:emilstenstrom:justhtml, distributed via PyPI (pip/justhtml).
Know when Justhtml gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
Bypasses require non-default advanced configs (AC:H) and a victim rendering the output (UI:R); XSS crosses into the browser (S:C) with limited C/I and no availability impact.
Primary rating from Vendor (VulnCheck).
CVSS VectorVendor: VulnCheck
Lifecycle Timeline
2DescriptionCVE.org
justhtml before 1.16.0 contains multiple HTML sanitization bypass issues that can allow active/dangerous content (e.g., script or style) to survive sanitization, potentially leading to cross-site scripting. The issues primarily affect advanced usage rather than the default JustHTML(..., sanitize=True) path for ordinary parsed HTML: mutating or reusing sanitization policy objects (including exported defaults) could weaken later sanitization; programmatic DOM input to sanitize()/sanitize_dom() could miss mixed-case tag names (e.g., ScRiPt, StYlE); crafted programmatic doctype names could serialize into active markup; and custom policies preserving SVG or MathML could allow animation elements, presentation attributes with external url(...) references, or DOM trees mislabeled as namespace="html" to bypass foreign-content checks. Fixed in 1.16.0.
Executive ViewAI
A critical XSS vulnerability in justhtml (versions ≤1.15.0) allows malicious scripts and styles to bypass HTML sanitization under certain configurations, exposing organizations using this library to account compromise and data theft through compromised web applications. Any organization processing user-supplied HTML or untrusted content through justhtml is at immediate risk.
Apply vendor patch.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Cross-Site Scripting occurs when an application accepts untrusted data and sends it to a web browser without proper validation or encoding.
Uncontrolled recursion in the justhtml Python HTML parsing library (all versions through 1.9.1) allows any remote unauth
Sanitizer bypass in the justhtml Python library (versions <= 1.11.0) allows attacker-controlled input to survive as raw
Sanitization bypass in justhtml (a Python HTML/Markdown sanitization library) before 1.15.0 lets attacker-controlled inp
Uncontrolled resource consumption in justhtml before 1.18.0 enables denial-of-service conditions through CPU and memory
Cross-site scripting in justhtml 0.9.0-1.21.0 allows an attacker who can control the text content of HTML code or pre el
Cross-site scripting in justhtml before 3.11.0 allows remote unauthenticated attackers to execute arbitrary JavaScript i
Mutation XSS in justhtml (versions ≤1.11.0) allows injection of arbitrary HTML into serialized output when applications
Mutation XSS (mXSS) in justhtml 1.13.0 and earlier enables markup injection bypass against applications using non-defaul
Cross-site scripting in justhtml versions before 1.13.0 allows attackers who control `<pre>` element content to break ou
Sanitization bypass in justhtml (Python HTML sanitization library) before version 1.17.0 enables cross-site scripting in
EUVD-2026-64658
GHSA-fj35-9vw4-h76v
NVD
CVE.org
EPSS
Vulnrichment
Exploit-DB