Web Application
CVE-2026-9769 high CVSS 7.5

Vulnerability in justhtml (CVE-2026-9769)

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が発生し、アプリケーションの処理が中断する可能性があります。

❓ What is the problem

justhtmlは制御されない再帰によりサービス拒否を引き起こす脆弱性があります。

📍 Affected scope

バージョン1.9.1までのjusthtml

🔥 Severity

攻撃者がHTMLを解析する際に深くネストされた要素を提供できると、RecursionErrorが発生し、サービス拒否状態になる可能性があります。

🔧 How to fix

バージョン1.10.0にアップデートすることで問題が修正されます。

🛡️ Workaround

情報なし

🔍 Detection

深くネストされたHTMLを提供するテストを実行し、アプリケーションが予期せず終了するかどうか確認します。

Affected packages

pip justhtml
[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.10.0"}]}]

References

We use cookies for analytics and ad measurement. This setting applies to all Game co., Ltd. sites. Details