Skip to content
Heist/ feed
Back to feed
High

Mistune: Potential DoS via quadratic-time parsing in parse_link_text

Type: advisorySources: OSV

Mistune is a Python Markdown parser with renderers and plugins. Prior to 3.3.0, Mistune is vulnerable to a CPU exhaustion DoS due to superlinear (approximately O(n²)) behavior in parse_link_text. When parsing Markdown containing many consecutive [ characters, parse_link_text repeatedly scans the input using a regex search inside a loop. Each iteration re-scans a large portion of the remaining string, resulting in quadratic-time behavior. An attacker-controlled Markdown input can therefore trigger excessive CPU usage with a very small payload. This vulnerability is fixed in 3.3.0.

Products
Not specified
Affected versions
Not specified
Fixed versions
Not specified
CVEs
CVE-2026-49851
Confirmed fixed CVEs
Not specified
Updated in this feed
3 Nov 2026, 15:26 UTC · Revision 1

Source evidence

Mistune: Potential DoS via quadratic-time parsing in parse_link_text

core-osv · Original source

Published 24 Jun 2026, 17:05 UTC

Mistune is a Python Markdown parser with renderers and plugins. Prior to 3.3.0, Mistune is vulnerable to a CPU exhaustion DoS due to superlinear (approximately O(n²)) behavior in parse_link_text. When parsing Markdown containing many consecutive [ characters, parse_link_text repeatedly scans the input using a regex search inside a loop. Each iteration re-scans a large portion of the remaining string, resulting in quadratic-time behavior. An attacker-controlled Markdown input can therefore trigger excessive CPU usage with a very small payload. This vulnerability is fixed in 3.3.0.

osv:CVE-2026-49851
Complete source record
{
  "id": "cb8d7deca2538e70ef40714ad3bf84c56a42229a66955c2dfdc860274b97659c",
  "url": "https://osv.dev/vulnerability/CVE-2026-49851",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "Mistune: Potential DoS via quadratic-time parsing in parse_link_text",
    "summary": "Mistune is a Python Markdown parser with renderers and plugins. Prior to 3.3.0, Mistune is vulnerable to a CPU exhaustion DoS due to superlinear (approximately O(n²)) behavior in parse_link_text. When parsing Markdown containing many consecutive [ characters, parse_link_text repeatedly scans the input using a regex search inside a loop. Each iteration re-scans a large portion of the remaining string, resulting in quadratic-time behavior. An attacker-controlled Markdown input can therefore trigger excessive CPU usage with a very small payload. This vulnerability is fixed in 3.3.0.",
    "evidence": "osv:CVE-2026-49851",
    "products": [],
    "severity": "high",
    "structured": {
      "id": "CVE-2026-49851",
      "aliases": [
        "CVE-2026-49851",
        "GHSA-qcq2-496w-v96p",
        "PYSEC-2026-2652"
      ],
      "metrics": [
        {
          "type": "CVSS_V4",
          "score": "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://github.com/lepture/mistune",
              "type": "GIT",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "fixed": "15c3b79325125272263d7d42492ec8f757447191"
                }
              ],
              "database_specific": {
                "extracted_events": [
                  {
                    "range": [
                      {
                        "introduced": "0"
                      },
                      {
                        "fixed": "3.3.0"
                      }
                    ],
                    "source": "AFFECTED_FIELD",
                    "strategy": "StringRangeExpression"
                  },
                  {
                    "range": [
                      {
                        "introduced": "0"
                      },
                      {
                        "fixed": "3.3.0"
                      }
                    ],
                    "source": "DESCRIPTION"
                  }
                ]
              }
            }
          ],
          "versions": [
            "v3.2.1",
            "v3.2.0",
            "v3.1.4",
            "v3.1.3",
            "v3.1.2",
            "v3.1.1",
            "v3.1.0",
            "v3.0.1",
            "v3.0.0",
            "v3.0.0rc5",
            "v3.0.0rc4",
            "v3.0.0rc3",
            "v3.0.0rc2",
            "v3.0.0rc1",
            "v3.0.0a3",
            "v3.0.0a2",
            "v3.0.0a1",
            "v2.0.2",
            "v2.0.1",
            "v2.0.0",
            "v2.0.0rc1",
            "v2.0.0a6",
            "v2.0.0a5",
            "v2.0.0a4",
            "v2.0.0a3",
            "v2.0.0a2",
            "v2.0.0a1",
            "v0.8.4",
            "v0.8.3",
            "v0.8.2",
            "v0.8.1",
            "v0.8",
            "v0.7.4",
            "v0.7.3",
            "v0.7.2",
            "v0.7.1",
            "v0.7",
            "v0.6",
            "v0.5.1",
            "v0.5",
            "v0.4.1",
            "v0.4",
            "v0.3.1",
            "v0.3.0",
            "v0.2.0",
            "v0.1.0"
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-49851.json"
          }
        }
      ],
      "modified": "2026-10-28T02:30:29.810342294Z",
      "provider": "osv",
      "references": [
        "https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-49851.json",
        "https://access.redhat.com/errata/RHSA-2026:60520",
        "https://access.redhat.com/security/cve/CVE-2026-49851",
        "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/49xxx/CVE-2026-49851.json",
        "https://github.com/lepture/mistune/security/advisories/GHSA-qcq2-496w-v96p",
        "https://nvd.nist.gov/vuln/detail/CVE-2026-49851",
        "https://bugzilla.redhat.com/show_bug.cgi?id=2492304"
      ],
      "provider_metadata": {
        "cwe_ids": [
          "CWE-400",
          "CWE-407",
          "CWE-770"
        ],
        "cna_assigner": "GitHub_M",
        "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/49xxx/CVE-2026-49851.json"
      }
    },
    "related_cves": [
      {
        "value": "CVE-2026-49851",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 496808,
  "published_at": "2026-06-24T17:05:33.602+00:00"
}