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

- **Severity:** High 8.7 (`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`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** No
- **Published:** 23 Aug 2026
- **Updated:** 24 Aug 2026
- **Also known as:** GHSA-hm7q-2p3r-88q4, GHSA-r8cj-3554-33mr

## 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 (Uncontrolled Resource Consumption)

## Which versions are affected by CVE-2026-4671?

2 open source packages ship an affected version, including justhtml.


| Package | Ecosystem | 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.

## Is CVE-2026-4671 being exploited?

There is no known exploitation of CVE-2026-4671 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-4671 and fix it if it is affected.

What it is: 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.
Exploitation: There is no known exploitation of CVE-2026-4671 in the wild and no public exploit code.

Affected packages and fixed versions:
- justhtml (PyPI): affected all versions; fixed in 1.18.0
- justhtml (PyPI): affected all versions; fixed in 1.18.0

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2026-4671/ (Markdown: https://insights.sbomify.com/CVE-2026-4671/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2026-4671
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2026-4671
- OSV: https://osv.dev/vulnerability/CVE-2026-4671

---
From sbomify Insights: https://insights.sbomify.com/CVE-2026-4671/
Summaries are generated and may contain mistakes; the official description above is the record.
