CVE-2026-9769 justhtml before 1.10.0 Denial of Service via deeply nested HTML

High 8.7 Published Updated

An attacker can cause a denial of service in the justhtml library by supplying deeply nested HTML that triggers an unhandled recursion error.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2026-9769?

CVE-2026-9769 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 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.

Weakness: CWE-674

Which versions are affected by CVE-2026-9769?

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

PackageAffectedFixed in
justhtml PyPIAll versions1.10.0
justhtml PyPIAll versions1.10.0
justhtml PyPIAll versions1.10.0

How do I fix CVE-2026-9769?

Upgrade justhtml to 1.10.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-9769 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-9769 exists.

Sources

Also known as GHSA-v7cf-c9rm-wm3j, PYSEC-2026-3854.

Is CVE-2026-9769 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free