CVE-2026-59925
inline_parser: quadratic-time parsing on long runs of `**x**` and `***x***` emphasis pairs
Mistune is a Python Markdown parser with renderers and plugins. Prior to 3.3.0, long sequences of well-formed double-asterisk or triple-asterisk emphasis pairs around a character cause quadratic work in src/mistune/inline_parser.py because the parser scans forward for matching close markers from every potential opening run, allowing denial of service in default Mistune parsing. This issue is fixed in version 3.3.0.
Attack profile
How easy it is to exploit
- Attack vector
- Network
- Complexity
- Low
- Privileges needed
- None
- User interaction
- None
What an attacker can affect
- Confidentiality
- None
- Integrity
- None
- Availability
- High
Exploit likelihood
What each source reports
CVE List Score used
7.5
inline_parser: quadratic-time parsing on long runs of `**x**` and `***x***` emphasis pairs
Mistune is a Python Markdown parser with renderers and plugins. Prior to 3.3.0, long sequences of well-formed double-asterisk or triple-asterisk emphasis pairs around a character cause quadratic work in src/mistune/inline_parser.py because the parser scans forward for matching close markers from every potential opening run, allowing denial of service in default Mistune parsing. This issue is fixed in version 3.3.0.
- Record
CVE-2026-59925- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H - Weakness
- CWE-407, CWE-1333
- Updated
- 2026-11-02
EUVDEUVD-2026-42335
7.5
Mistune is a Python Markdown parser with renderers and plugins. Prior to 3.3.0, long sequences of well-formed double-asterisk or triple-asterisk emphasis pairs around a character cause quadratic work in src/mistune/inline_parser.py because the parser scans forward for matching close markers from every potential opening run, allowing denial of service in default Mistune parsing. This issue is fixed in version 3.3.0.
- Record
EUVD-2026-42335- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H - Updated
- 2026-11-02
GitHub AdvisoriesGHSA-4j32-57v6-6g45
7.5
Mistune inline_parser: quadratic-time parsing on long runs of `**x**` and `***x***` emphasis pairs
Summary
Type: Algorithmic-complexity DoS in core emphasis parsing. A long sequence of well-formed **x** (strong) or ***x*** (strong-emphasis combined) pairs causes O(N²) parser work. Distinct from the bracket-bomb DoS ([ repetition) and from the formatting-plugin DoS (~~/==/^^); this one fires on default-config mistune with no plugins required.
File: src/mistune/inline_parser.py lines 41-48 (the EMPHASIS_END_RE family) and the surrounding emphasis dispatch.
Root cause: for every opening run of *s the parser scans forward using one of EMPHASIS_END_RE['*'] / ['**'] / ['***'] to find the matching close. Each scan is bounded per call, but the parser invokes the scan from every potential start position. For input shaped **x** repeated N times, every ** is treated as a potential start, each scan can cover up to the end of input. Total work is O(N²). The triple-emphasis variant ***x*** is slightly worse due to the extra alternation between *, **, and *** close patterns. Reproducible against default mistune with no plugins.
Affected Code
File: src/mistune/inline_parser.py, lines 41-48.
EMPHASIS_END_RE = {
"*": re.compile(r"(?:" + PREVENT_BACKSLASH + r"\\\*|[^\s*])\*(?!\*)"),
"_": re.compile(r"(?:" + PREVENT_BACKSLASH + r"\\_|[^\s_])_(?!_)\b"),
"**": re.compile(r"(?:" + PREVENT_BACKSLASH + r"\\\*|[^\s*])\*\*(?!\*)"),
"__": re.compile(r"(?:" + PREVENT_BACKSLASH + r"\\_|[^\s_])__(?!_)\b"),
"***": re.compile(r"(?:" + PREVENT_BACKSLASH + r"\\\*|[^\s*])\*\*\*(?!\*)"),
"___": re.compile(r"(?:" + PREVENT_BACKSLASH + r"\\_|[^\s_])___(?!_)\b"),
}
# Each of the six end-patterns is invoked from every emphasis open position
# fired by the inline rule `r"\*{1,3}(?=[^\s*])|\b_{1,3}(?=[^\s_])"`. The
# scan itself is bounded per call; the cost comes from the parser invoking
# the scan at every matching open marker, giving O(N²) total work.
Why it's wrong: same shape as the formatting-plugin and bracket-bomb DoS findings. The CommonMark reference parser handles emphasis in linear time using a delimiter-stack algorithm (commonmark.js, commonmark-py, markdown-it-py all do this). mistune retries the close-scan from each open marker. The bounded regex is not enough; the surrounding loop is the source of the quadratic.
Exploit Chain
- Application uses mistune to render user-supplied markdown. No plugins required — affects the default
mistune.create_markdown()configuration. - Attacker submits a 40 KB payload of
**x**repeated 8000 times. - Server CPU pegs for ~4 seconds; 16 KB → ~17 seconds. Doubling input quadruples time.
- Repeating the request floods the worker pool.
Security Impact
Severity: sec-high. Network-reachable, no authentication, no plugin requirement. Default mistune is vulnerable.
Attacker capability: O(N²) CPU cost from a single small input. Predictable scaling, easy to combine with concurrent requests for service denial.
Preconditions: application uses mistune.create_markdown() (default config) on attacker-supplied markdown. No plugins required.
Differential: PoC-verified against [email protected], default config:
import mistune, time
md = mistune.create_markdown() # no plugins
for n in [500, 1000, 2000, 4000, 8000]:
s = '**x**' * n
t = time.time()
md(s)
print(f' **x** * {n} ({len(s)}b): {(time.time() - t) * 1000:.0f}ms')
# Output (Python 3.13, Linux, 2.5GHz CPU):
# **x** * 500 (2500b): 20ms
# **x** * 1000 (5000b): 74ms
# **x** * 2000 (10000b): 284ms
# **x** * 4000 (20000b): 1079ms
# **x** * 8000 (40000b): 4309ms
# Triple-emphasis is similar:
md('***x***' * 4000) # ~1500ms
# Linear in N for non-emphasis input of comparable size:
md('xxxxx' * 8000) # 1ms (4000x faster)
The patched build (with the suggested fix below — delimiter-stack rewrite or hard cap on simultaneous open markers) keeps the time linear…
- Record
GHSA-4j32-57v6-6g45- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H - Weakness
- CWE-407, CWE-1333
- Updated
- 2026-11-02
NVD
7.5
Mistune is a Python Markdown parser with renderers and plugins. Prior to 3.3.0, long sequences of well-formed double-asterisk or triple-asterisk emphasis pairs around a character cause quadratic work in src/mistune/inline_parser.py because the parser scans forward for matching close markers from every potential opening run, allowing denial of service in default Mistune parsing. This issue is fixed in version 3.3.0.
- Record
CVE-2026-59925- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H - Weakness
- CWE-407, CWE-1333
- Updated
- 2026-11-02
OSV
7.5
inline_parser: quadratic-time parsing on long runs of `**x**` and `***x***` emphasis pairs
Mistune is a Python Markdown parser with renderers and plugins. Prior to 3.3.0, long sequences of well-formed double-asterisk or triple-asterisk emphasis pairs around a character cause quadratic work in src/mistune/inline_parser.py because the parser scans forward for matching close markers from every potential opening run, allowing denial of service in default Mistune parsing. This issue is fixed in version 3.3.0.
- Record
CVE-2026-59925- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H - Weakness
- CWE-1333, CWE-407
- Updated
- 2026-11-02
OSVDEBIAN-CVE-2026-59925
7.5
Mistune is a Python Markdown parser with renderers and plugins. Prior to 3.3.0, long sequences of well-formed double-asterisk or triple-asterisk emphasis pairs around a character cause quadratic work in src/mistune/inline_parser.py because the parser scans forward for matching close markers from every potential opening run, allowing denial of service in default Mistune parsing. This issue is fixed in version 3.3.0.
- Record
DEBIAN-CVE-2026-59925- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H - Updated
- 2026-11-02
Show 6 moreShow less
OSVGHSA-4j32-57v6-6g45
7.5
Mistune inline_parser: quadratic-time parsing on long runs of `**x**` and `***x***` emphasis pairs
Summary
Type: Algorithmic-complexity DoS in core emphasis parsing. A long sequence of well-formed **x** (strong) or ***x*** (strong-emphasis combined) pairs causes O(N²) parser work. Distinct from the bracket-bomb DoS ([ repetition) and from the formatting-plugin DoS (~~/==/^^); this one fires on default-config mistune with no plugins required.
File: src/mistune/inline_parser.py lines 41-48 (the EMPHASIS_END_RE family) and the surrounding emphasis dispatch.
Root cause: for every opening run of *s the parser scans forward using one of EMPHASIS_END_RE['*'] / ['**'] / ['***'] to find the matching close. Each scan is bounded per call, but the parser invokes the scan from every potential start position. For input shaped **x** repeated N times, every ** is treated as a potential start, each scan can cover up to the end of input. Total work is O(N²). The triple-emphasis variant ***x*** is slightly worse due to the extra alternation between *, **, and *** close patterns. Reproducible against default mistune with no plugins.
Affected Code
File: src/mistune/inline_parser.py, lines 41-48.
EMPHASIS_END_RE = {
"*": re.compile(r"(?:" + PREVENT_BACKSLASH + r"\\\*|[^\s*])\*(?!\*)"),
"_": re.compile(r"(?:" + PREVENT_BACKSLASH + r"\\_|[^\s_])_(?!_)\b"),
"**": re.compile(r"(?:" + PREVENT_BACKSLASH + r"\\\*|[^\s*])\*\*(?!\*)"),
"__": re.compile(r"(?:" + PREVENT_BACKSLASH + r"\\_|[^\s_])__(?!_)\b"),
"***": re.compile(r"(?:" + PREVENT_BACKSLASH + r"\\\*|[^\s*])\*\*\*(?!\*)"),
"___": re.compile(r"(?:" + PREVENT_BACKSLASH + r"\\_|[^\s_])___(?!_)\b"),
}
# Each of the six end-patterns is invoked from every emphasis open position
# fired by the inline rule `r"\*{1,3}(?=[^\s*])|\b_{1,3}(?=[^\s_])"`. The
# scan itself is bounded per call; the cost comes from the parser invoking
# the scan at every matching open marker, giving O(N²) total work.
Why it's wrong: same shape as the formatting-plugin and bracket-bomb DoS findings. The CommonMark reference parser handles emphasis in linear time using a delimiter-stack algorithm (commonmark.js, commonmark-py, markdown-it-py all do this). mistune retries the close-scan from each open marker. The bounded regex is not enough; the surrounding loop is the source of the quadratic.
Exploit Chain
- Application uses mistune to render user-supplied markdown. No plugins required — affects the default
mistune.create_markdown()configuration. - Attacker submits a 40 KB payload of
**x**repeated 8000 times. - Server CPU pegs for ~4 seconds; 16 KB → ~17 seconds. Doubling input quadruples time.
- Repeating the request floods the worker pool.
Security Impact
Severity: sec-high. Network-reachable, no authentication, no plugin requirement. Default mistune is vulnerable.
Attacker capability: O(N²) CPU cost from a single small input. Predictable scaling, easy to combine with concurrent requests for service denial.
Preconditions: application uses mistune.create_markdown() (default config) on attacker-supplied markdown. No plugins required.
Differential: PoC-verified against [email protected], default config:
import mistune, time
md = mistune.create_markdown() # no plugins
for n in [500, 1000, 2000, 4000, 8000]:
s = '**x**' * n
t = time.time()
md(s)
print(f' **x** * {n} ({len(s)}b): {(time.time() - t) * 1000:.0f}ms')
# Output (Python 3.13, Linux, 2.5GHz CPU):
# **x** * 500 (2500b): 20ms
# **x** * 1000 (5000b): 74ms
# **x** * 2000 (10000b): 284ms
# **x** * 4000 (20000b): 1079ms
# **x** * 8000 (40000b): 4309ms
# Triple-emphasis is similar:
md('***x***' * 4000) # ~1500ms
# Linear in N for non-emphasis input of comparable size:
md('xxxxx' * 8000) # 1ms (4000x faster)
The patched build (with the suggested fix below — delimiter-stack rewrite or hard cap on simultaneous open markers) keeps the time linear…
- Record
GHSA-4j32-57v6-6g45- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H - Weakness
- CWE-1333, CWE-407
- Updated
- 2026-11-02
OSVPYSEC-2026-2213
7.5
Mistune is a Python Markdown parser with renderers and plugins. Prior to 3.3.0, long sequences of well-formed double-asterisk or triple-asterisk emphasis pairs around a character cause quadratic work in src/mistune/inline_parser.py because the parser scans forward for matching close markers from every potential opening run, allowing denial of service in default Mistune parsing. This issue is fixed in version 3.3.0.
- Record
PYSEC-2026-2213- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H - Updated
- 2026-11-02
OSVUBUNTU-CVE-2026-59925
7.5
Mistune is a Python Markdown parser with renderers and plugins. Prior to 3.3.0, long sequences of well-formed double-asterisk or triple-asterisk emphasis pairs around a character cause quadratic work in src/mistune/inline_parser.py because the parser scans forward for matching close markers from every potential opening run, allowing denial of service in default Mistune parsing. This issue is fixed in version 3.3.0.
- Record
UBUNTU-CVE-2026-59925- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H - Updated
- 2026-11-02
OSVAZL-92217 No score
CVE-2026-59925 affecting package python-mistune for versions less than 3.3.0-1
Mistune is a Python Markdown parser with renderers and plugins. Prior to 3.3.0, long sequences of well-formed double-asterisk or triple-asterisk emphasis pairs around a character cause quadratic work in src/mistune/inline_parser.py because the parser scans forward for matching close markers from every potential opening run, allowing denial of service in default Mistune parsing. This issue is fixed in version 3.3.0.
- Record
AZL-92217- Updated
- 2026-11-02
OSVopenSUSE-SU-2026:21339-1 No score
Security update for python-mistune
This update for python-mistune fixes the following issues
- CVE-2026-59922: quadratic-time parsing on long runs of some markers in
formatting.pycan lead to DoS (bsc#1271117). - CVE-2026-59923:
HTMLRenderer.safe_url()does not block percent-encoded javascript URIs and allows for XSS (bsc#1271119). - CVE-2026-59924: improper processing of user-supplied include paths in
Include.parse()can lead to path traversal and arbitrary file reads (bsc#1271121). - CVE-2026-59925: quadratic-time parsing on long runs of some emphasis pairs in
inline_parsercan lead to DoS (bsc#1271125). - CVE-2026-59926: improper escaping in
render_admonition()can lead to atribute injection and XSS (bsc#1271127). - CVE-2026-59927: uncontrolled recursion when processing two markdown files that include each other can lead to a DoS (bsc#1271128).
- CVE-2026-59928: quadratic-time parsing on long lists of repeated reference-link definitions in
block_parsercan lead to DoS (bsc#1271131). - CVE-2026-59929: HARMFUL_PROTOCOLS list misses legacy and chained schemes and allow arbitrary script execution in user agents (bsc#1271132).
- CVE-2026-59930: the
tocplugin andTableOfContentsdirective generate heading IDs with predictable values and allow for collisions with attacker-controlledid="toc_N"content (bsc#1271082).
- Record
openSUSE-SU-2026:21339-1- Updated
- 2026-11-02
OSVSUSE-SU-2026:22655-1 No score
Security update for python-mistune
This update for python-mistune fixes the following issues
- CVE-2026-59922: quadratic-time parsing on long runs of some markers in
formatting.pycan lead to DoS (bsc#1271117). - CVE-2026-59923:
HTMLRenderer.safe_url()does not block percent-encoded javascript URIs and allows for XSS (bsc#1271119). - CVE-2026-59924: improper processing of user-supplied include paths in
Include.parse()can lead to path traversal and arbitrary file reads (bsc#1271121). - CVE-2026-59925: quadratic-time parsing on long runs of some emphasis pairs in
inline_parsercan lead to DoS (bsc#1271125). - CVE-2026-59926: improper escaping in
render_admonition()can lead to atribute injection and XSS (bsc#1271127). - CVE-2026-59927: uncontrolled recursion when processing two markdown files that include each other can lead to a DoS (bsc#1271128).
- CVE-2026-59928: quadratic-time parsing on long lists of repeated reference-link definitions in
block_parsercan lead to DoS (bsc#1271131). - CVE-2026-59929: HARMFUL_PROTOCOLS list misses legacy and chained schemes and allow arbitrary script execution in user agents (bsc#1271132).
- CVE-2026-59930: the
tocplugin andTableOfContentsdirective generate heading IDs with predictable values and allow for collisions with attacker-controlledid="toc_N"content (bsc#1271082).
- Record
SUSE-SU-2026:22655-1- Updated
- 2026-11-02
Affected products
Affected packages
| Package | Affected | Fixed |
|---|---|---|
mistunePyPI |
before 3.3.0 | 3.3.0 |
python-mistuneAzure Linux:3 |
before 3.3.0-1 | 3.3.0-1 |
mistuneDebian:13 |
All versions, plus listed versions 3.1.3-13.1.4-13.3.4-13.4.0-1 |
None known |
mistuneDebian:14 |
All versions, plus listed versions 3.1.3-13.1.4-13.3.4-13.4.0-1 |
None known |
mistunePyPI |
before 3.3.0, plus listed versions 0.1.00.2.00.3.00.3.10.4 Show 45 moreShow less0.4.10.50.5.10.60.70.7.10.7.20.7.30.7.40.80.8.10.8.20.8.30.8.42.0.02.0.0a12.0.0a22.0.0a32.0.0a42.0.0a52.0.0a62.0.0rc12.0.12.0.22.0.32.0.42.0.52.1.03.0.03.0.0a13.0.0a23.0.0a33.0.0rc13.0.0rc23.0.0rc33.0.0rc43.0.0rc53.0.13.0.23.1.03.1.13.1.23.1.33.1.43.2.0 |
3.3.0 |
python-mistuneSUSE:Linux Enterprise Server 16.0 From an advisory covering 10 CVEs |
before 3.1.3-160000.5.1 | 3.1.3-160000.5.1 |
python-mistuneSUSE:Linux Enterprise Server for SAP applications 16.0 From an advisory covering 10 CVEs |
before 3.1.3-160000.5.1 | 3.1.3-160000.5.1 |
mistuneUbuntu:16.04:LTS |
All versions, plus listed versions 0.6-20.7.1-1 |
None known |
mistuneUbuntu:18.04:LTS |
All versions, plus listed versions 0.7.4-10.8-10.8.1-10.8.3-2 |
None known |
mistuneUbuntu:20.04:LTS |
All versions, plus listed versions 0.8.4-10.8.4-2 |
None known |
Show 6 moreShow less
| Package | Affected | Fixed |
|---|---|---|
mistuneUbuntu:22.04:LTS |
All versions, plus listed versions 0.8.4-40.8.4-52.0.0-1+really0.8.4-1 |
None known |
mistuneUbuntu:24.04:LTS |
All versions, plus listed versions 2.0.4-23.0.2-1 |
None known |
mistuneUbuntu:25.10 |
All versions, plus listed versions 3.0.2-23.1.3-1 |
None known |
mistuneUbuntu:26.10 |
All versions, plus listed versions 3.1.4-1 |
None known |
mistuneUbuntu:26.04:LTS |
All versions, plus listed versions 3.1.3-13.1.4-1 |
None known |
python-mistuneopenSUSE:Leap 16.0 From an advisory covering 10 CVEs |
before 3.1.3-160000.5.1 | 3.1.3-160000.5.1 |
History
| Recorded | Changed | Sources |
|---|---|---|
| affected, facts | ||
| first indexed | CVE List, EUVD, GitHub Advisories, NVD, OSV |
Dates are when Every CVE recorded each change. Upstream dates may differ.
In short
CVE-2026-59925 is a high vulnerability (CVSS 7.5) in Lepture Mistune, published July 8, 2026. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 0.64%, the 51st percentile. Fixed in mistune 3.3.0.
References
github.com/lepture/mistune/security/advisories/GHSA-4j32-57v6-6g45
github.com/lepture/mistune/commit/5de41fb8e527004dbc363e047a3c380c9288c74f
github.com/lepture/mistune/releases/tag/v3.3.0
nvd.nist.gov/vuln/detail/CVE-2026-59925
github.com/pypa/advisory-database/tree/main/vulns/mistune/PYSEC-2026-2213.yaml
github.com/advisories/GHSA-4j32-57v6-6g45
Show 25 moreShow less
github.com/CVEProject/cvelistV5/tree/main/cves/2026/59xxx/CVE-2026-59925.json
security-tracker.debian.org/tracker/CVE-2026-59925
github.com/lepture/mistune
suse.com/support/update/announcement/2026/suse-su-202622655-1
bugzilla.suse.com/1271082
bugzilla.suse.com/1271117
bugzilla.suse.com/1271119
bugzilla.suse.com/1271121
bugzilla.suse.com/1271125
bugzilla.suse.com/1271127
bugzilla.suse.com/1271128
bugzilla.suse.com/1271131
bugzilla.suse.com/1271132
suse.com/security/cve/CVE-2026-44896
suse.com/security/cve/CVE-2026-59922
suse.com/security/cve/CVE-2026-59923
suse.com/security/cve/CVE-2026-59924
suse.com/security/cve/CVE-2026-59925
suse.com/security/cve/CVE-2026-59926
suse.com/security/cve/CVE-2026-59927
suse.com/security/cve/CVE-2026-59928
suse.com/security/cve/CVE-2026-59929
suse.com/security/cve/CVE-2026-59930
ubuntu.com/security/CVE-2026-59925
cve.org/CVERecord?id=CVE-2026-59925
Left out here: 1 version and the rest of 2 source descriptions. The JSON record has them.