Uncontrolled recursion DoS in JustHTML() via deeply nested HTML
概要
Uncontrolled recursion DoS in JustHTML() via deeply nested HTML
原文の説明
取得元が公開している説明をそのまま載せています (多くは英語)。
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."""…
出典: NIST National Vulnerability Database NVD GitHub Advisory
AI要約
外部の AI が作成した要約です。誤りを含むことがあります。重要な判断の前に、下の原文と参照URLを確認してください。
justhtmlの1.9.1以前のバージョンには、制御されない再帰によるサービス拒否の脆弱性があります。HTML解析中に深くネストされた要素を提供することで、CPythonのデフォルトの再帰制限を超えるとRecursionErrorが発生し、アプリケーションの処理が中断する可能性があります。
justhtmlは制御されない再帰によりサービス拒否を引き起こす脆弱性があります。
バージョン1.9.1までのjusthtml
攻撃者がHTMLを解析する際に深くネストされた要素を提供できると、RecursionErrorが発生し、サービス拒否状態になる可能性があります。
バージョン1.10.0にアップデートすることで問題が修正されます。
情報なし
深くネストされたHTMLを提供するテストを実行し、アプリケーションが予期せず終了するかどうか確認します。
影響パッケージ
参照URL
- web github.com
- web disclosure@vulncheck.com
- web nvd.nist.gov
- web github.com
- web github.com
- web github.com