Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessIdentify endpoint accepting attacker-controlled selector or text input
-
DeliverySubmit crafted pathological selector, cyclic DOM structure, or bracket-heavy linkification payload
-
ExploitTrigger unbounded parse, match, or traversal loop in justhtml
-
ExecutionExhaust server CPU or memory
-
ImpactCause application process denial of service
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A06:2025 - Insecure Design
ASVS 5.0
V2 - Validation and Business Logic Resource consumption limits
MITRE ATT&CK
1 technique across 1 tactic: Impact The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | Exploitation requires one of four specific non-default application conditions: (1) the application accepts attacker-controlled CSS selector strings and passes them to justhtml's query(), matches(), or selector-based transform APIs; (2) the application runs selector matching over attacker-supplied HTML documents without size limits; (3) the application constructs or mutates DOM trees programmatically from untrusted structure, enabling cyclic graph traversal; or (4) the application enables the Linkify feature over attacker-controlled text. The vendor's advisory explicitly states that default JustHTML(sanitize=True) usage is not expected to expose untrusted selectors because selectors are normally supplied by application code. Factors limiting exploitation: impact is purely availability with no confidentiality or integrity consequence; non-default configuration is required in all attack paths; and the library must be reachable via a network-exposed endpoint processing attacker input in one of these modes. |
| Impact | The vendor-assigned CVSS 4.0 score of 8.7 (AV:N/AC:L/AT:N/PR:N/UI:N/VA:H) may overstate real-world risk because AT:N (no attack requirements) does not reflect the advisory's explicit statement that default sanitization configurations are not exposed. Exploitation requires a specific non-default application design - one that passes attacker-controlled selector strings to query() or matches(), enables Linkify over untrusted text, or constructs DOM trees from untrusted structure. A more precise CVSS 4.0 model would assign AT:P, and CVSS 3.1 AC:H, materially lowering the score. EPSS data is absent from the provided intelligence and cannot be quantified. No CISA KEV listing exists and no public exploit code has been identified, making opportunistic mass exploitation implausible. The realistic threat is a targeted DoS against a narrow class of custom applications using non-default justhtml features. Priority is moderate for affected deployments and low for the broader Python ecosystem. |
| Exploit ScenarioDerived | An attacker submits a crafted CSS selector string - such as a deeply nested :not(:not(:not(...))) chain, a selector list with thousands of entries, or a long combinator sequence - to a web endpoint that accepts user-supplied selectors and forwards them to justhtml's query() or matches() APIs. The library evaluates the selector without resource bounds, causing the serving process to spin on CPU or exhaust heap memory until the request times out or the process is killed. No public exploit code has been identified at time of analysis, though the triggering patterns are fully disclosed in the advisory, making reproduction straightforward for a researcher or attacker with library access. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Aug 23, 2026
Uncontrolled resource consumption in justhtml before 1.18.0 enables denial-of-service conditions through CPU and memory exhaustion when processing attacker-controlled CSS selectors, large untrusted documents, cyclic DOM graphs, or linkification input. The impact is strictly availability - the advisory explicitly confirms no script execution, data disclosure, or sanitizer bypass is possible. No public exploit has been identified at time of analysis, and default JustHTML(sanitize=True) configurations are not expected to be exposed; risk is confined to applications that forward untrusted input into selector-evaluation or linkification APIs.
RemediationAI
Upgrade justhtml to version 1.18.0 or later using pip install --upgrade 'justhtml>=1.18.0'; this is the vendor-released patch confirmed by GHSA-r8cj-3554-33mr and is the only complete fix. If immediate upgrade is not feasible, application-level compensating controls can reduce exposure: validate and enforce a maximum length and nesting depth on any CSS selector strings accepted from users before passing them to query() or matches(); disable the Linkify feature if not required by the application; cap the size of HTML documents processed through selector-based transform pipelines; and avoid constructing or mutating DOM trees programmatically from untrusted input. Each of these controls narrows but does not eliminate the attack surface in unpatched versions - upgrade remains the definitive remediation. Full advisory: https://github.com/EmilStenstrom/justhtml/security/advisories/GHSA-r8cj-3554-33mr.
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 HTML sanitization library (cpe:2.3:a:emilstenstrom:justhtml:*:*:*:*:*:*:*:*) that parses HTML and supports CSS-selector-based querying and transformation pipelines. The root cause is CWE-400 (Uncontrolled Resource Consumption): prior to 1.18.0 the library imposed no resource limits on selector parsing or matching, allowing pathological inputs to consume unbounded CPU or heap memory. Specific vulnerable code paths include: CSS selector parsing without structural caps (oversized selectors, large selector lists, deep combinator chains, nested functional pseudo-classes like :not()); DOM graph traversal that enters infinite or duplicate loops on cyclic child, parent, or text-traversal graphs; and the Linkify subsystem rescanning punctuation-heavy or trailing-bracket-heavy input repeatedly. Version 1.18.0 introduces shared selector resource controls - parse-depth caps, structural length limits for selector lists and compound selectors, and match-operation and string-byte budgets - to bound all affected paths.
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:N/VI:N/VA:H/SC:N/SI:N/SA:N
Non-default application configuration required to expose attacker input to selector APIs justifies AC:H; impact is availability-only with no confidentiality or integrity consequence.
Primary rating from Vendor (VulnCheck).
CVSS VectorVendor: VulnCheck
Lifecycle Timeline
2DescriptionCVE.org
justhtml before 1.18.0 contains multiple low-severity denial-of-service issues in CSS selector handling and linkification. Applications that evaluate attacker-controlled selector strings (via query(), matches(), or selector-based transforms), run selector matching over very large untrusted documents, construct DOM trees from untrusted structure, or enable linkification over attacker-controlled text may consume disproportionate CPU or memory. Triggers include oversized selectors, large selector lists, oversized compound selectors, long combinator chains, deeply nested functional pseudo-classes, repeated token/positional matching, cyclic DOM graphs causing non-terminating traversal, and punctuation-heavy or trailing-bracket linkification input. These are availability-only concerns and do not by themselves allow script execution, data disclosure, or sanitizer bypass. Default JustHTML(sanitize=True) usage is not expected to be exposed, since selectors are normally supplied by application code.
Executive ViewAI
JustHTML library versions before 1.18.0 contain a denial-of-service vulnerability enabling resource exhaustion attacks that could render affected applications unavailable; no public exploit identified at time of analysis. Organizations running applications with this library should prioritize patching, particularly those exposed to untrusted user input. Risk concentration depends on specific API usage patterns-applications that restrict untrusted content to specific processing functions face lower risk than those broadly exposing CSS and HTML linkification capabilities.
Apply vendor patch. Until deployment is complete, implement rate-limiting on CSS selector evaluation and linkification APIs, restrict these functions from direct exposure to untrusted input, and monitor system resource consumption for anomalous CPU or memory usage patterns.
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
Denial of Service attacks render applications or systems unavailable by overwhelming resources or triggering failure conditions.
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
Cross-site scripting via HTML sanitization bypass affects justhtml (a Python HTML parsing/sanitization library by EmilSt
Sanitization bypass in justhtml (a Python HTML/Markdown sanitization library) before 1.15.0 lets attacker-controlled inp
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-64651
GHSA-hm7q-2p3r-88q4
NVD
CVE.org
EPSS
Vulnrichment
Exploit-DB