python-markdown2: Denial of service via unclosed inline link destinations
Summary
python-markdown2 through version 2.5.5 is a Python library that converts Markdown to HTML. Crafted Markdown with repeated unclosed inline link sequences makes the parser rescan the remaining document for each link, so CPU time grows quadratically. A remote attacker who can submit Markdown text to an application using the library can exhaust CPU resources and cause a denial of service.
Affected
- python-markdown2 versions 0 through 2.5.5
- Applications that render untrusted Markdown with this library, including transitive dependencies
Fixed in
Unknown. No confirmed fixed release was found at the time of writing. Upstream issue #750 and pull request #751 are relevant but their merge and release status could not be confirmed.
Workaround
- Pin the current version and monitor upstream pull request #751 and new releases for a fix
- Limit the size of Markdown input before parsing
- Run Markdown rendering with a timeout or in a separate worker process
- Rate-limit submissions to public endpoints that render Markdown
- Render user content as plain text where links are not required
Exploitation
- Not known to be exploited in the wild; not listed in CISA KEV
- The maintainer's public issue #750 describes a reproduction with timing measurements
- The trigger pattern is publicly described in the CVE text
Our recommendation
- Check inventories for markdown2, including transitive dependencies
- Prioritise internet-facing applications that render user content (medium to high); internal tools that render only trusted text are lower priority
- Apply the upstream fix once released, and apply the mitigations above until then
- Monitor the upstream project and CVE records for an update
Public exploits
PoC-in-GitHub, Metasploit and Exploit-DB list nothing for this CVE.
Research sources
- python-markdown2 GitHub repository github.com
- Upstream issue #750 github.com
- Upstream pull request #751 github.com
- VulnCheck advisory www.vulncheck.com
- markdown2.py at 2.5.5 (_find_balanced) github.com
- Ubuntu CVE-2026-118694 ubuntu.com
Researched and written up in English and German by an AI (Claude by Anthropic) based on NVD, CISA, EPSS and the sources listed. The vendor information is authoritative. Researched on 31 Oct 2026, 23:44.
Original description (NVD)
python-markdown2 through 2.5.5 contains a denial of service vulnerability that allows remote users to exhaust CPU by submitting Markdown with unclosed inline link destinations. Attackers can submit repeated '[a](' or '
- https://github.com/trentm/python-markdown2
- https://github.com/trentm/python-markdown2/blob/2.5.5/lib/markdown2.py#L1478-L1492
- https://github.com/trentm/python-markdown2/blob/2.5.5/lib/markdown2.py#L3029
- https://github.com/trentm/python-markdown2/issues/750
- https://github.com/trentm/python-markdown2/pull/751
- https://www.vulncheck.com/advisories/python-markdown2-through-2.5.5-denial-of-service-via-unclosed-inline-lin…
Sources
The tracker combines official, freely usable data sources – updated continuously:
- NVD (NIST) – CVEs, rating (CVSS), affected products
- CISA KEV – vulnerabilities confirmed by CISA as actively exploited
- CISA Vulnrichment – CISA assessment (SSVC) in the official CVE record
- FIRST EPSS – probability of exploitation
- Microsoft MSRC – Patch Tuesday: vulnerabilities, severity, updates
- PoC-in-GitHub – public proof-of-concept repositories
- Metasploit (Rapid7) – modules of the Metasploit Framework
- Exploit-DB (OffSec) – archive of public exploits (links only)
- Patch days: official vendor pages (linked per vendor) (Vendor patch days)
This product uses data from the NVD API but is not endorsed or certified by the NVD. EPSS data © FIRST.org.
Affected? We can help.
We check whether your systems are affected, install updates and close the gap – continuously with the System Health Checker if you wish.
