CVE-2026-9769: Uncontrolled Recursion in EmilStenstrom justhtml
justhtml versions through 1.9.1 contain an uncontrolled recursion vulnerability that can lead to denial of service. The issue arises during the construction of JustHTML() where TreeBuilder.finish() calls _populate_selectedcontent(), which recursively traverses the DOM tree without limiting recursion depth. An attacker supplying deeply nested HTML elements can trigger a RecursionError in CPython, potentially aborting parsing or terminating processes depending on exception handling. This vulnerability is fixed in version 1.10.0.
AI Analysis
Technical Summary
The justhtml library up to version 1.9.1 suffers from uncontrolled recursion during HTML parsing. Specifically, the TreeBuilder.finish() method calls _populate_selectedcontent(), which recursively traverses the DOM tree via _find_elements()/_find_element() without a recursion depth limit. An attacker able to supply crafted HTML with deeply nested elements (e.g., ~1000 nested <div> tags) can exceed CPython's default recursion limit, causing an unhandled RecursionError. This can lead to denial of service by aborting parsing, failing requests, or terminating worker processes depending on the host application's exception handling. The vulnerability is addressed in justhtml version 1.10.0.
Potential Impact
Exploitation of this vulnerability allows an attacker to cause a denial of service by triggering a RecursionError during HTML parsing. This can result in aborted parsing operations, failed requests, or termination of worker processes, impacting availability of applications using affected justhtml versions.
Mitigation Recommendations
Upgrade justhtml to version 1.10.0 or later where this uncontrolled recursion vulnerability is fixed. No official patch or temporary fix is indicated other than upgrading. Until upgraded, applications should consider limiting or sanitizing input HTML depth if possible to mitigate risk.
CVE-2026-9769: Uncontrolled Recursion in EmilStenstrom justhtml
Description
justhtml versions through 1.9.1 contain an uncontrolled recursion vulnerability that can lead to denial of service. The issue arises during the construction of JustHTML() where TreeBuilder.finish() calls _populate_selectedcontent(), which recursively traverses the DOM tree without limiting recursion depth. An attacker supplying deeply nested HTML elements can trigger a RecursionError in CPython, potentially aborting parsing or terminating processes depending on exception handling. This vulnerability is fixed in version 1.10.0.
CVSS v4.0
Score 8.7high
Affected software
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The justhtml library up to version 1.9.1 suffers from uncontrolled recursion during HTML parsing. Specifically, the TreeBuilder.finish() method calls _populate_selectedcontent(), which recursively traverses the DOM tree via _find_elements()/_find_element() without a recursion depth limit. An attacker able to supply crafted HTML with deeply nested elements (e.g., ~1000 nested <div> tags) can exceed CPython's default recursion limit, causing an unhandled RecursionError. This can lead to denial of service by aborting parsing, failing requests, or terminating worker processes depending on the host application's exception handling. The vulnerability is addressed in justhtml version 1.10.0.
Potential Impact
Exploitation of this vulnerability allows an attacker to cause a denial of service by triggering a RecursionError during HTML parsing. This can result in aborted parsing operations, failed requests, or termination of worker processes, impacting availability of applications using affected justhtml versions.
Mitigation Recommendations
Upgrade justhtml to version 1.10.0 or later where this uncontrolled recursion vulnerability is fixed. No official patch or temporary fix is indicated other than upgrading. Until upgraded, applications should consider limiting or sanitizing input HTML depth if possible to mitigate risk.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- VulnCheck
- Date Reserved
- 2026-05-27T20:38:38.588Z
- Cvss Version
- 4.0
- State
- PUBLISHED
- Remediation Level
- null
Threat ID: 6a8afb29acd9273b49f5f751
Added to database: 08/23/2026, 13:52:41 UTC
Last enriched: 08/23/2026, 14:07:05 UTC
Last updated: 08/23/2026, 14:56:32 UTC
Views: 6
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.