---
id: CVE-2026-9769
title: >-
  justhtml through 1.9.1 (fixed in 1.10.0) is vulnerable to uncontrolled
  recursion leading to denial of service
summary: >-
  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 trav…
severity: high
cvss: 7.5
cvssVector: 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H'
cwe:
  - CWE-674
vendor: justhtml
product: justhtml
affected:
  - justhtml < 1.10.0
patched:
  - justhtml 1.10.0
published: '2026-08-23'
updated: '2026-10-12'
sourceUpdated: '2026-10-12T16:10:00.220'
source: NVD
sourceUrl: 'https://nvd.nist.gov/vuln/detail/CVE-2026-9769'
references:
  - url: >-
      https://github.com/EmilStenstrom/justhtml/security/advisories/GHSA-v7cf-c9rm-wm3j
    label: disclosure@vulncheck.com
  - url: >-
      https://www.vulncheck.com/advisories/justhtml-before-denial-of-service-via-deeply-nested-html
    label: disclosure@vulncheck.com
  - url: >-
      https://github.com/EmilStenstrom/justhtml/security/advisories/GHSA-v7cf-c9rm-wm3j
    label: 134c704f-9b21-4f2e-91b3-4a467353bcc0
  - url: 'https://nvd.nist.gov/vuln/detail/CVE-2026-9769'
  - url: 'https://github.com/EmilStenstrom/justhtml'
  - url: 'https://github.com/EmilStenstrom/justhtml/releases/tag/v1.10.0'
  - url: 'https://pypi.org/project/justhtml'
  - url: 'https://github.com/advisories/GHSA-v7cf-c9rm-wm3j'
tags:
  - nvd
  - osv
  - pip
epss: 0.00337
epssPercentile: 0.26904
aliases:
  - GHSA-v7cf-c9rm-wm3j
  - PYSEC-2026-3854
ecosystem: pip
ingestedAt: '2026-08-24T19:25:44.417Z'
---

## Overview

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.

## Remediation

Refer to the linked advisories for vendor-supplied fixes and affected version ranges.

## Package advisory (CVE-2026-9769)

Affected packages:

- `justhtml < 1.10.0`

Patched in:

- `justhtml 1.10.0`

Source: https://osv.dev/vulnerability/GHSA-v7cf-c9rm-wm3j
