Web Application
CVE-2026-76098 high CVSS 7.5

Vulnerability in mistune (CVE-2026-76098)

Summary

Vulnerability in mistune (CVE-2026-76098). Risk of unauthorized operations or information disclosure. Mitigation: upgrade to 3.3.3 or later.

Original description

The description as published by the source.

Summary

Mistune v3.3.2 is vulnerable to a Denial of Service (DoS) attack via uncontrolled recursion in the HTML rendering of deeply-nested emphasis tokens. By submitting Markdown containing approximately 1,000 consecutive asterisk characters, an attacker causes the Python process to crash with RecursionError.

Details

The InlineParser's _process_emphasis_delimiters() creates deeply nested tokens from consecutive emphasis markers (every 2 asterisks add one nesting level). With 1,000 consecutive asterisks, approximately 500 levels of nesting are produced. The HTMLRenderer.render_token() method (src/mistune/renderers/html.py:40-57) renders these tokens recursively: when a token has children, line 48 calls self.render_tokens(token['children'], state), entering child rendering. Each nesting level produces ~2 stack frames, so 500 levels ≈ 1,000 frames, exceeding Python's default recursion limit (sys.getrecursionlimit() = 1000). The emphasis() and strong() methods (lines 80-84) wrap recursively rendered child content in and tags, perpetuating the recursion. This vulnerability affects all mistune APIs including markdown() and html().

Core vulnerable code path:

# src/mistune/renderers/html.py:40-57
def render_token(self, token: Dict[str, Any], state: BlockState) -> str:
    func = self._get_method(token["type"])
    attrs = token.get("attrs")
    if "raw" in token:
        text = token["raw"]
    elif "children" in token:
        text = self.render_tokens(token["c…

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.

Mistuneのバージョン3.3.0から3.3.2には、深くネストされたトークンによるDoSの脆弱性があります。HTMLレンダリング中に発生する再帰レンダリングがPythonの再帰制限を超え、RecursionErrorを引き起こす可能性があります。この問題はバージョン3.3.3で修正されています。

❓ What is the problem

MistuneのMarkdownパーサーが、深くネストされたトークンによるDoSの影響を受ける。

📍 Affected scope

バージョン3.3.0から3.3.2のMistune

🔥 Severity

HTMLレンダリングがPythonの再帰制限を超えクラッシュを引き起こすため、高い影響がある。

🔧 How to fix

バージョン3.3.3にアップデートする。

🛡️ Workaround

一時的にMarkdown解析の深さを制限する。

🔍 Detection

Markdownファイルを解析し、深くネストされたトークンの存在を確認する。

Affected packages

pip mistune
[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"3.3.3"}]}]

Fix status by distribution

Fixed packages published by each distribution for this CVE

References

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