---
id: "CVE-2019-25781"
kind: "vulnerability"
aliases: ["CVE-2019-25781"]
title: "Python-Markdown: unmatched brackets let short input exhaust CPU"
severity: "high"
cvss: 8.7
epss: null
exploited: false
status: "open"
category: "package"
products: []
ecosystems: []
tags: ["markdown", "package", "python", "web-apps"]
not_affected_if: ["trusted-input-only"]
published_at: "2026-10-29T14:17:39+00:00"
first_seen_at: "2026-10-29T14:25:22+00:00"
updated_at: "2026-10-29T14:25:51+00:00"
sources: [{"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2019-25781", "first_seen_at": "2026-10-29T14:25:22+00:00"}]
---

# Python-Markdown: unmatched brackets let short input exhaust CPU

Python-Markdown versions 3.0 through 3.11.2 parse inline links with a quadratic-time routine, so repeated unmatched brackets take minutes of CPU. A remote attacker can tie up worker processes with a short Markdown message, causing denial of service.

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

## How to check

- Run `pip show markdown` or `python -c "import markdown; print(markdown.__version__)"` and check whether the version is between `3.0` and `3.11.2`
- Search requirements files and lock files for `markdown` to find pinned versions

## Fix

- Python-Markdown: move to a version newer than `3.11.2` (the sources do not name the exact fixed release)

## Timeline

- 2026-10-29T14:25:22+00:00 nvd https://nvd.nist.gov/vuln/detail/CVE-2019-25781

## From the sources

Python-Markdown 3.0 through 3.11.2 contains an algorithmic complexity vulnerability in inline link parsing that allows remote attackers to exhaust CPU through unmatched brackets. Attackers can submit short Markdown containing repeated [ or ![ characters, forcing LinkInlineProcessor.getText() and getLink() into quadratic scans that keep workers busy for minutes.

---

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