CVE-2026-4671 justhtml before 1.18.0 Denial of Service via CSS Selector
An attacker can cause excessive CPU or memory consumption in justhtml by providing malicious CSS selectors or linkification inputs, leading to denial of service.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- None listed
What is CVE-2026-4671?
CVE-2026-4671 is a high-severity denial of service vulnerability in EmilStenstrom justhtml, published on 23 Aug 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.
Official description
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.
Weakness: CWE-400
Which versions are affected by CVE-2026-4671?
2 open source packages ship an affected version, including justhtml.
| Package | Affected | Fixed in |
|---|---|---|
justhtml PyPI | All versions | 1.18.0 |
justhtml PyPI | All versions | 1.18.0 |
How do I fix CVE-2026-4671?
Upgrade justhtml to 1.18.0 or later.
Upgrade, then put limits on request size, rate and nesting depth so one client cannot exhaust the service. More about Denial of service.
Is CVE-2026-4671 being exploited?
There is no known exploitation of CVE-2026-4671 in the wild and no public exploit code.
Sources
Also known as GHSA-hm7q-2p3r-88q4, GHSA-r8cj-3554-33mr.