Skip to main content

justhtml EUVDEUVD-2026-64658

| CVE-2026-7808 CRITICAL
Improper Input Validation (CWE-20)
2026-08-23 VulnCheck GHSA-fj35-9vw4-h76v
9.3
CVSS 4.0 · Vendor: VulnCheck
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Craft malicious HTML/SVG for vulnerable config
  2. Delivery
    Submit to app using custom or programmatic sanitization
  3. Exploit
    Bypass sanitizer (mixed-case tag or SVG animation/url)
  4. Execution
    Store or reflect active content
  5. Persist
    Victim renders sanitized output
  6. Impact
    Script 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.

Act Now Prioritize within 24-48h. Why: CRITICAL severity.
Patch available 0.4% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – 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

justhtml 0 <1.16.0

Affected Packages

pypi justhtml fix: 1.16.0

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

Vendor (VulnCheck) PRIMARY 9.3 CRITICAL
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
vuln.today AI 4.7 MEDIUM

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.

3.1 AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:N
4.0 AV:N/AC:H/AT:N/PR:N/UI:P/VC:L/VI:L/VA:N/SC:L/SI:L/SA:N

Primary rating from Vendor (VulnCheck).

CVSS VectorVendor: VulnCheck

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
None
Privileges Required
None
User Interaction
None
Vulnerable system: Confidentiality
High
Vulnerable system: Integrity
High
Vulnerable system: Availability
High
Subsequent system: Confidentiality
None
Subsequent system: Integrity
None
Subsequent system: Availability
None

Lifecycle Timeline

2
Patch available
Aug 23, 2026 - 14:01 EUVD
CVE Published
Aug 23, 2026 - 13:34 cve.org
CRITICAL 9.3

DescriptionCVE.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

Why It Matters

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.

Business Impact: Severe
Compensating Controls

Apply vendor patch.

Threat Intelligence Overview

EPSS Score
0.4%
Top 72% exploitable
Prevalence
Low
niche Python HTML-sanitization library, limited PyPI/enterprise footprint
Social Media
4
Sightings
Data Quality
6 sources
Confidence: High

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.

SignalValue
Severity CRITICAL
CISA KEV No
Public POC No
EPSS 0.4%
Patch available Yes
Active threat No
Deciding rule
CRITICAL severity
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision
Out-of-Cycle
Exploitation
None
System Exposure· derived
Open
Automatable
Yes
Human Impact
Very High
Technical Impact
Total

Priority Score

46
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +46
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Cross-Site Scripting occurs when an application accepts untrusted data and sends it to a web browser without proper validation or encoding.

CVE-2026-9769 HIGH POC
8.7 Aug 23

Uncontrolled recursion in the justhtml Python HTML parsing library (all versions through 1.9.1) allows any remote unauth

CVE-2026-8445 CRITICAL
9.3 Aug 23

Sanitizer bypass in the justhtml Python library (versions <= 1.11.0) allows attacker-controlled input to survive as raw

CVE-2026-5388 CRITICAL
9.3 Aug 23

Sanitization bypass in justhtml (a Python HTML/Markdown sanitization library) before 1.15.0 lets attacker-controlled inp

CVE-2026-4671 HIGH
8.7 Aug 23

Uncontrolled resource consumption in justhtml before 1.18.0 enables denial-of-service conditions through CPU and memory

CVE-2026-77088 MEDIUM
5.3 Aug 23

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

CVE-2026-74793 MEDIUM
5.1 Aug 23

Cross-site scripting in justhtml before 3.11.0 allows remote unauthenticated attackers to execute arbitrary JavaScript i

CVE-2026-8630 MEDIUM
5.1 Aug 23

Mutation XSS in justhtml (versions ≤1.11.0) allows injection of arbitrary HTML into serialized output when applications

CVE-2026-5751 MEDIUM
5.1 Aug 23

Mutation XSS (mXSS) in justhtml 1.13.0 and earlier enables markup injection bypass against applications using non-defaul

CVE-2026-5389 MEDIUM
5.1 Aug 23

Cross-site scripting in justhtml versions before 1.13.0 allows attackers who control `<pre>` element content to break ou

CVE-2026-6827 MEDIUM
5.1 Aug 23

Sanitization bypass in justhtml (Python HTML sanitization library) before version 1.17.0 enables cross-site scripting in

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy