Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessSend HTTP request with ~11 KB deeply nested HTML payload
-
DeliveryApplication passes input to JustHTML() constructor
-
ExploitTreeBuilder.finish() unconditionally calls _populate_selectedcontent()
-
Execution_find_elements() recurses depth-first across ~1000 DOM levels
-
PersistCPython default recursion limit exceeded
-
ImpactUnhandled RecursionError aborts parsing or terminates worker process
Vulnerability Assessment
| Weakness |
CWE
ASVS 5.0
V15 - Secure Coding and Architecture Recursion depth limits
|
| Exploitation Conditions | Exploitation requires that the target application accepts HTML content from attacker-controlled input (e.g., a user-submitted form field, an API body, or a URL-fetched document) and passes it directly to the JustHTML() constructor without pre-filtering for nesting depth or element count. The host runtime must be CPython - the vulnerability depends on CPython's default recursion limit of 1,000 frames; runtimes with higher limits or tail-call optimization would require proportionally deeper nesting. No authentication is required, no non-default configuration is needed, and no specific operating system or platform is required beyond a standard CPython install with justhtml <= 1.9.1. Exploitation is strictly limited to denial-of-service; no code execution or data disclosure is possible. The real-world limiting factor is application-layer exposure: services that only parse internally generated or pre-validated HTML are not reachable via this vector. |
| Impact | The CVSS 4.0 vector (AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N, score 8.7) accurately reflects this vulnerability: the attack is network-reachable, requires no authentication, imposes no complexity barrier, and delivers high availability impact. The attack is highly automatable - a static ~11 KB payload reliably triggers the crash regardless of application state. Real-world risk is bounded by two factors: first, only applications that pass externally supplied HTML to JustHTML() are in scope; second, justhtml is a niche Python library with a limited production footprint, substantially narrowing the population of reachable targets. No EPSS data was provided in the source intelligence, so exploitation probability cannot be quantified beyond what the CVSS vector implies. The vulnerability is not listed in CISA KEV, and no formal POC repository has been identified, though the GHSA advisory references exact file paths, line numbers, call chains, and payload size - sufficient for any competent practitioner to reproduce without further research. The fix is available as version 1.10.0, and the upgrade path is straightforward. Applications that sanitize or restrict HTML input depth prior to parsing, or that do not accept untrusted HTML, are not at practical risk. |
| Exploit ScenarioDerived | An attacker submits a crafted HTTP POST body containing approximately 1,000 nested <div> tags (~11 KB) to any endpoint that passes the request body or a form field to JustHTML() for parsing. The application invokes JustHTML(attacker_html), which triggers the unbounded _find_elements() recursion; when the call stack hits CPython's 1,000-frame limit, an unhandled RecursionError is raised. Depending on whether the host framework catches the exception, this either returns a 500 error to the attacker (failing the request) or terminates the worker process, potentially taking all concurrent requests offline. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Aug 23, 2026
Uncontrolled recursion in the justhtml Python HTML parsing library (all versions through 1.9.1) allows any remote unauthenticated attacker who can supply HTML input to trigger a denial of service via stack exhaustion. Approximately 1,000 nested HTML elements (~11 KB of crafted input) are sufficient to exceed CPython's default recursion limit of 1,000 frames during DOM traversal in TreeBuilder._find_elements(), raising an unhandled RecursionError that can abort parsing, fail requests, or terminate a worker process depending on framework error handling. Vendor patch 1.10.0 is available; no public exploit code or CISA KEV listing has been identified at time of analysis, though the advisory's code-level detail makes independent reproduction trivial.
RemediationAI
Upgrade justhtml to version 1.10.0 or later using pip install --upgrade justhtml; this is the definitive fix as confirmed by the vendor advisory at https://github.com/EmilStenstром/justhtml/security/advisories/GHSA-v7cf-c9rm-wm3j. If an immediate upgrade is not feasible, the most effective compensating control is to enforce a maximum nesting depth or size limit on HTML input before passing it to JustHTML() - rejecting or truncating inputs with DOM depth exceeding ~500 levels eliminates the attack path without altering library behavior for legitimate inputs. Wrapping JustHTML() calls in a try/except RecursionError handler will prevent worker termination but will still fail individual requests silently; this is a containment measure only and does not eliminate the vulnerability. Raising sys.setrecursionlimit() is not recommended as a mitigation - it defers rather than prevents stack exhaustion and increases process memory consumption. Applications that do not accept HTML from untrusted sources face no practical risk from this vector and may prioritize the upgrade within normal change management cadence.
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 parsing library published by Emil Stenstrom as a pip package (CPE: cpe:2.3:a:emilstenstrom:justhtml:*:*:*:*:*:*:*:*). The root cause is CWE-674 (Uncontrolled Recursion): every JustHTML() construction unconditionally reaches TreeBuilder.finish() (treebuilder.py#L476), which calls _populate_selectedcontent() (line 494), which in turn invokes _find_elements() - a depth-first recursive DOM traversal that searches for <select> elements with no depth bound or iteration limit. CPython enforces a default call stack cap of 1,000 frames via sys.getrecursionlimit(); a DOM tree deeper than this exhausts the stack and raises an unhandled RecursionError. The same unbounded recursion pattern independently affects Node.clone_node(deep=True) on already-parsed deep trees. The flaw is specific to CPython's stack-based execution model and does not manifest in runtimes with higher or configurable limits, though CPython is the dominant Python runtime in production deployments.
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
Network-reachable unauthenticated DoS with no confidentiality or integrity impact; scope unchanged as only the vulnerable process is affected.
Primary rating from Vendor (VulnCheck).
CVSS VectorVendor: VulnCheck
Lifecycle Timeline
2DescriptionCVE.org
justhtml through 1.9.1 (fixed in 1.10.0) is vulnerable to uncontrolled recursion leading to denial of service. During JustHTML() construction, TreeBuilder.finish() unconditionally calls _populate_selectedcontent(), which recursively traverses the DOM tree via _find_elements()/_find_element() without a depth bound. An attacker who can supply HTML for parsing can provide deeply nested elements (e.g., ~1000 nested <div> tags, roughly 11 KB) to exceed CPython's default recursion limit and trigger an unhandled RecursionError, which may abort parsing, fail requests, or terminate a worker/process depending on the host application's exception handling.
Latest POC
1 public PoC link from github
Sign in to open the public PoC links collected for this CVE.
Executive ViewAI
The justhtml Python library (versions through 1.9.1) contains a remote denial-of-service vulnerability affecting any application that uses it to parse HTML content. Attackers can crash applications with just 11 KB of specially crafted HTML, requiring no prior authentication or access. Organizations deploying justhtml should treat this as high priority for service stability and availability.
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
Denial of Service attacks render applications or systems unavailable by overwhelming resources or triggering failure conditions.
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
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-64661
GHSA-892m-gcq8-2468
NVD
CVE.org
EPSS
Vulnrichment
VulDB
Exploit-DB