Summary
Vulnerability in justhtml (CVE-2026-9769). Risk of unauthorized operations or information disclosure. Exploitable via RecursionError. Mitigation: upgrade to 1.10.0 or later.
Original description
The description as published by the source.
Summary
justhtml through 1.9.1 allows denial of service via deeply nested HTML. During parsing, JustHTML.__init__() always reaches TreeBuilder.finish(), which unconditionally calls _populate_selectedcontent(). That function recursively traverses the DOM via _find_elements() / _find_element() without a depth bound, allowing attacker-controlled deeply nested input to trigger an unhandled RecursionError on CPython. Depending on the host application's exception handling, this can abort parsing, fail requests, or terminate a worker/process.
Details
TreeBuilder.finish() (treebuilder.py#L476) unconditionally calls _populate_selectedcontent(self.document) at line 494. _populate_selectedcontent() (treebuilder.py#L1243) calls _find_elements() (treebuilder.py#L1280) to recursively search the DOM tree for `` elements:
def _find_elements(self, node: Any, name: str, result: list[Any]) -> None:
"""Recursively find all elements with given name."""…
Source: NIST National Vulnerability Database NVD GitHub Advisory
AI summary
Written by an external AI model and may contain mistakes. Check the original description and references below before acting on it.
justhtmlの1.9.1以前のバージョンには、制御されない再帰によるサービス拒否の脆弱性があります。HTML解析中に深くネストされた要素を提供することで、CPythonのデフォルトの再帰制限を超えるとRecursionErrorが発生し、アプリケーションの処理が中断する可能性があります。
justhtmlは制御されない再帰によりサービス拒否を引き起こす脆弱性があります。
バージョン1.9.1までのjusthtml
攻撃者がHTMLを解析する際に深くネストされた要素を提供できると、RecursionErrorが発生し、サービス拒否状態になる可能性があります。
バージョン1.10.0にアップデートすることで問題が修正されます。
情報なし
深くネストされたHTMLを提供するテストを実行し、アプリケーションが予期せず終了するかどうか確認します。
Affected packages
References
- web github.com
- web disclosure@vulncheck.com
- web nvd.nist.gov
- web github.com
- web github.com
- web github.com