CVE-2026-97698: Mistune: Quadratic-time DoS in parse_link_href via unbounded parenthesis scan on empty-label links
Published 2026-11-19 · Updated 2026-11-19 · Also known as GHSA-phmp-hrw4-r36r
Summary
Mistune is vulnerable to a quadratic-time denial-of-service (DoS) attack caused by an unbounded parenthesis scan in the parse_link_href function. Users of Mistune versions prior to 3.3.4 should upgrade immediately to prevent CPU exhaustion from malicious markdown inputs.
Who is affected
The vulnerability allows an unauthenticated attacker to cause significant CPU resource consumption by submitting specially crafted markdown containing empty-label link patterns like '[]('. This input pattern bypasses existing high-water mark guards, forcing the renderer into an O(N²) scanning loop that can pin a worker process at 100% utilization for extended periods.
Exploitability
The vulnerability is rated High with a CVSS 3.1 base score of 7.5, reflecting that it is remotely exploitable without authentication or user interaction. While the EPSS score of 0.007 indicates a relatively low current frequency of exploitation, the vulnerability is not currently listed on the CISA Known Exploited Vulnerabilities catalog.
Remediation
- Upgrade the Mistune package to version 3.3.4 or later.
- Review application infrastructure to ensure that markdown rendering processes are subject to timeouts and resource limits to mitigate potential DoS vectors.
How to check your project
- Check the project's dependency manifest (e.g., requirements.txt, pyproject.toml, or poetry.lock) for any Mistune version lower than 3.3.4.
- Run 'pip show mistune' in the target environment to identify the currently installed version of the package.
Automated analysis of the published advisory data, generated 2026-11-19. Not human-reviewed; verify against the official advisory. How this works.
Affected packages
| Ecosystem | Package | Affected versions | Fixed in | Upgrade |
|---|---|---|---|---|
| PyPI | mistune |
>= 0, < 3.3.4 | 3.3.4 | python -m pip install 'mistune>=3.3.4' |
CVSS 3.1 vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
| Attack vector | Network |
|---|---|
| Attack complexity | Low |
| Privileges required | None |
| User interaction | None |
| Scope | Unchanged |
| Confidentiality | None |
| Integrity | None |
| Availability | High |
FAQ
What specifically triggers this vulnerability?
The vulnerability is triggered by rendering markdown inputs containing repeated '[](' sequences, which causes the parser's href scanner to perform redundant, inefficient scans to the end of the document.
Does this impact all Mistune users?
It impacts users running versions of Mistune prior to 3.3.4 who render untrusted markdown content, regardless of whether additional plugins are enabled.
Is there a workaround if I cannot upgrade immediately?
No specific workaround is documented; upgrading to version 3.3.4 is the recommended method to resolve the underlying scanning logic flaw.
Original advisory description
References
- WEB https://github.com/lepture/mistune/security/advisories/GHSA-phmp-hrw4-r36r
- ADVISORY https://nvd.nist.gov/vuln/detail/CVE-2026-97698
- WEB https://github.com/lepture/mistune/commit/b4dd3284e52ec741ed9a227db29ade9017828e90
- PACKAGE https://github.com/lepture/mistune
- WEB https://github.com/lepture/mistune/releases/tag/v3.3.4
Source records: GHSA-phmp-hrw4-r36r (OSV.dev) · EPSS by FIRST, 2026-11-26.