Skip to content
Fencer Vulns
medium 5.3

CVE-2023-26485 json

Quadratic complexity may lead to a denial of service in cmark-gfm

published 2023-03-31 3 y ago modified 2026-06-17 4 mo ago also EUVD-2023-30291

cvss
5.3
version 3.1, CNA
cisa kev
Not listed
not in CISA's catalog
epss
1.0%
EPSS 1.0% chance of exploitation in 30 days, percentile 63%
public exploits
0
none known

Summary

cmark-gfm is GitHub's fork of cmark, a CommonMark parsing and rendering library and program in C. A polynomial time complexity issue in cmark-gfm may lead to unbounded resource exhaustion and subsequent denial of service. This CVE covers quadratic complexity issues when parsing text which leads with either large numbers of `_` characters. This issue has been addressed in version 0.29.0.gfm.10. Users are advised to upgrade. Users unable to upgrade should validate that their input comes from trusted sources.

### Impact

A polynomial time complexity issue in cmark-gfm may lead to unbounded resource exhaustion and subsequent denial of service.

### Proof of concept

``` $ ~/cmark-gfm$ python3 -c 'pad = "_" * 100000; print(pad + "." + pad, end="")' | time ./build/src/cmark-gfm --to plaintext ```

Increasing the number 10000 in the above commands causes the running time to increase quadratically.

### Patches

This vulnerability have been patched in 0.29.0.gfm.10.

### Note on cmark and cmark-gfm

XXX: TBD

[cmark-gfm](https://github.com/github/cmark-gfm) is a fork of [cmark](https://github.com/commonmark/cmark) that adds the GitHub Flavored Markdown extensions. The two codebases have diverged over time, but share a common core. These bugs affect both `cmark` and `cmark-gfm`.

### Credit

We would like to thank @gravypod for reporting this vulnerability.

### References

https://en.wikipedia.org/wiki/Time_complexity

### For more information

If you have any questions or comments about this advisory:

* Open an issue in [github/cmark-gfm](https://github.com/github/cmark-gfm)

Patch / fix

  • github cmark-gfm 0.29.0.gfm.10
  • cmark-gfm Debian 14, Debian 13 0.29.0.gfm.13-1
  • python-cmarkgfm Debian 14, Debian 13 2024.11.20-1
  • r-cran-commonmark Debian 14, Debian 13 1.9.1-1
  • ruby-commonmarker Debian 14, Debian 13 0.23.10-1

debian advisories DEBIAN-CVE-2023-26485

  • cmark-gfm Ubuntu Pro 20.04 LTS 0.29.0.gfm.0-4ubuntu0.1~esm1
  • cmark-gfm Ubuntu Pro 22.04 LTS 0.29.0.gfm.3-3ubuntu0.1~esm1
  • cmark-gfm Ubuntu Pro 24.04 LTS 0.29.0.gfm.6-6ubuntu0.24.04.1~esm1

ubuntu advisories UBUNTU-CVE-2023-26485

Ubuntu security data © Canonical Ltd., from https://github.com/canonical/ubuntu-security-notices via OSV; changed: normalised to fixed package versions per release. CC BY-SA 4.0

Vendor advisories

What the vendors themselves say about their products: affected, fixed or not affected, and what to do.

red hat product security vex CVE-2023-26485 updated cvss 7.5

commonmarker: Quadratic complexity bug may lead to a denial of service

  • Red Hat 3scale API Management Platform 2 commonmarker commonmarker
    affected: no fix available

Red Hat CSAF VEX © Red Hat, Inc., from https://security.access.redhat.com/data/csaf/v2/vex/; changed: reduced to product statuses and remediations. CC BY 4.0 · csaf

CISA SSVC

Exploitation
Proof of concept is public
Automatable
yes
Technical impact
partial
Assessed
20 mo ago

Exploit prediction

1.03% chance of exploitation in the next 30 days, higher than 63% of all scored CVEs (FIRST EPSS, 2026-11-08).

Exploits and checks

  • github.com https://github.com/github/cmark-gfm/security/advisories/GHSA-r8vr-c48j-fcc5 referenced PoC, tagged "exploit" by a source, unverified

CVSS scores

assigned by version score vector
CNA 3.1 5.3 CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
NVD 3.1 7.5 CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

Affected products

  • github cmark-gfm

Classification

Weakness
  • CWE-400 Uncontrolled Resource Consumption
  • CWE-407 Inefficient Algorithmic Complexity

References

Sources

Fencer Vulns keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.