Skip to main content

justhtml CVE-2026-9769

| EUVDEUVD-2026-64661 HIGH
Uncontrolled Recursion (CWE-674)
8.7
CVSS 4.0 · Vendor: VulnCheck
View

Attack ChainAIDerived

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

  1. Access
    Send HTTP request with ~11 KB deeply nested HTML payload
  2. Delivery
    Application passes input to JustHTML() constructor
  3. Exploit
    TreeBuilder.finish() unconditionally calls _populate_selectedcontent()
  4. Execution
    _find_elements() recurses depth-first across ~1000 DOM levels
  5. Persist
    CPython default recursion limit exceeded
  6. Impact
    Unhandled 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.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
1 public PoC Patch available 0.3% exploitation probability (EPSS)

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

Alert me

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

justhtml 0 <1.10.0

Affected Packages

pypi justhtml fix: 1.10.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 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

Vendor (VulnCheck) PRIMARY 8.7 HIGH
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
vuln.today AI 7.5 HIGH

Network-reachable unauthenticated DoS with no confidentiality or integrity impact; scope unchanged as only the vulnerable process is affected.

3.1 AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
4.0 AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/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
None
Vulnerable system: Integrity
None
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
HIGH 8.7

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

Why It Matters

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.

Business Impact: High
Compensating Controls

Apply vendor patch.

Threat Intelligence Overview

EPSS Score
0.3%
Top 80% exploitable
Prevalence
Low
niche Python HTML parsing library, limited production deployment footprint
Threat Intel
1
1 sources
Social Media
1
Sightings
Data Quality
7 sources
Confidence: High
EUVD NVD CVE.org EPSS Vulnrichment GHSA CIRCL GitHub VulDB

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 HIGH
CISA KEV No
Public POC Yes
EPSS 0.3%
Patch available Yes
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.9)
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
Poc
System Exposure· derived
Open
Automatable
Yes
Human Impact
High
Technical Impact
Partial

Priority Score

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

Attack Technique

Denial of Service attacks render applications or systems unavailable by overwhelming resources or triggering failure conditions.

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-7808 CRITICAL
9.3 Aug 23

Cross-site scripting via HTML sanitization bypass affects justhtml (a Python HTML parsing/sanitization library by EmilSt

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