---
id: "CVE-2026-118694"
kind: "vulnerability"
aliases: ["CVE-2026-118694"]
title: "python-markdown2: unclosed link syntax lets remote users exhaust CPU"
severity: "high"
cvss: 8.7
epss: null
exploited: false
status: "open"
category: "package"
products: []
ecosystems: []
tags: ["markdown", "package", "python", "self-hosted"]
not_affected_if: ["no-untrusted-markdown", "not-using-markdown2"]
published_at: "2026-10-28T22:17:13+00:00"
first_seen_at: "2026-10-28T22:35:34+00:00"
updated_at: "2026-10-28T22:36:36+00:00"
sources: [{"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-118694", "first_seen_at": "2026-10-28T22:35:34+00:00"}]
---

# python-markdown2: unclosed link syntax lets remote users exhaust CPU

python-markdown2 through 2.5.5 rescans the rest of the document for each unclosed inline link, so crafted Markdown with repeated '[a](' or '![a](' takes quadratic CPU time. A remote user who can submit Markdown can make the process spend the CPU and stall other requests.

_Summary, check and fix written by a model from the sources; labelled as such._

## How to check

- Run `pip show markdown2` or `python -c "import markdown2; print(markdown2.__version__)"` and compare against `2.5.5`
- Check whether user-submitted Markdown is rendered with markdown2 on any public endpoint

## Fix

- Upgrade python-markdown2 to a release later than `2.5.5` (exact fixed version unknown from the sources)
- Until upgraded, limit the size of submitted Markdown and apply request timeouts on rendering endpoints

## Timeline

- 2026-10-28T22:35:34+00:00 nvd https://nvd.nist.gov/vuln/detail/CVE-2026-118694

## From the sources

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 '![a](' sequences, causing _find_balanced to rescan the remaining document for each link and consume quadratic CPU time.

---

_Free to read at a human pace. An API with keys and an MCP server are in preparation; early access: hello@infrastack.ai_
