Skip to main content

justhtml EUVDEUVD-2026-64651

| CVE-2026-4671 HIGH
Uncontrolled Resource Consumption (CWE-400)
2026-08-23 VulnCheck GHSA-hm7q-2p3r-88q4
8.7
CVSS 4.0 · Vendor: VulnCheck
View

Attack ChainAIDerived

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

  1. Access
    Identify endpoint accepting attacker-controlled selector or text input
  2. Delivery
    Submit crafted pathological selector, cyclic DOM structure, or bracket-heavy linkification payload
  3. Exploit
    Trigger unbounded parse, match, or traversal loop in justhtml
  4. Execution
    Exhaust server CPU or memory
  5. Impact
    Cause 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.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
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

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

justhtml 0 <1.18.0

Affected Packages

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

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 5.9 MEDIUM

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.

3.1 AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H
4.0 AV:N/AC:L/AT:P/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 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

Why It Matters

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.

Business Impact: High
Compensating Controls

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

EPSS Score
0.4%
Top 70% exploitable
Prevalence
Low
niche Python HTML sanitization library with limited enterprise adoption
Social Media
2
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 HIGH
CISA KEV No
Public POC No
EPSS 0.4%
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
Scheduled
Exploitation
None
System Exposure· derived
Open
Automatable
Yes
Human Impact
High
Technical Impact
Partial

Priority Score

44
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +44
PoC: 0
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-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-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-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