Skip to content

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

HighCVSS 7.5 EPSS 1.0%
Published
Updated
Exploit status
No public exploit known
CISA SSVC
Proof of concept public · automatable: yes · technical impact: partial
Technology
UbuntuDebian

Description

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 is a fork of 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:

Upgrade path

25 packages: 14 fixed, 11 with no fix yet.

PackageAffectedFixed inStatus
debian/cmark-gfm(Debian 12) = 0.29.0.gfm.6-6; = 0.29.0.gfm.13-1; = 0.29.0.gfm.13-2; = 0.29.0.gfm.13-3 +4 more No fix listed No fix yet
debian/python-cmarkgfm(Debian 12) = 0.8.0-3; = 2024.11.20-1; = 2025.10.22-1; = 2025.10.22-2 +1 more No fix listed No fix yet
debian/r-cran-commonmark(Debian 12) = 1.8.1-1; = 1.9.0-1; = 1.9.1-1; = 1.9.2-1 +6 more No fix listed No fix yet
debian/ruby-commonmarker(Debian 12) = 0.23.6-1; = 0.23.9-1; = 0.23.10-1; = 2.8.3-1 +7 more No fix listed No fix yet
ubuntu/cmark(Ubuntu 18.04) = 0.26.1-1; All versions No fix listed No fix yet
ubuntu/cmark(Ubuntu 20.04) = 0.28.3-1; = 0.29.0-1ubuntu2; = 0.29.0-2; All versions No fix listed No fix yet
ubuntu/cmark(Ubuntu 22.04) = 0.29.0-4; = 0.30.2-3; = 0.30.2-4; = 0.30.2-5 +1 more No fix listed No fix yet
ubuntu/cmark(Ubuntu 24.04) = 0.30.2-6; = 0.30.2-6build1; All versions No fix listed No fix yet
ubuntu/cmark(Ubuntu 25.10) = 0.30.2-6build1; All versions No fix listed No fix yet
ubuntu/cmark(Ubuntu 26.04) = 0.30.2-6build1; = 0.30.2-6build2; All versions No fix listed No fix yet
ubuntu/cmark(Ubuntu 26.10) = 0.30.2-6build2; All versions No fix listed No fix yet
debian/cmark-gfm(Debian 13) < 0.29.0.gfm.13-1 0.29.0.gfm.13-1 Fixed
debian/cmark-gfm(Debian 14) < 0.29.0.gfm.13-1 0.29.0.gfm.13-1 Fixed
debian/python-cmarkgfm(Debian 13) < 2024.11.20-1 2024.11.20-1 Fixed
debian/python-cmarkgfm(Debian 14) < 2024.11.20-1 2024.11.20-1 Fixed
debian/r-cran-commonmark(Debian 13) < 1.9.1-1 1.9.1-1 Fixed
debian/r-cran-commonmark(Debian 14) < 1.9.1-1 1.9.1-1 Fixed
debian/ruby-commonmarker(Debian 13) < 0.23.10-1 0.23.10-1 Fixed
debian/ruby-commonmarker(Debian 14) < 0.23.10-1 0.23.10-1 Fixed
GitHub cmark-gfm < 0.29.0.gfm.10; = < 0.29.0.gfm.10 0.29.0.gfm.10 Fixed
ubuntu/cmark-gfm(Ubuntu 22.04) < 0.29.0.gfm.3-3ubuntu0.1~esm1 0.29.0.gfm.3-3ubuntu0.1~esm1 Fixed
ubuntu/cmark-gfm(Ubuntu 24.04) < 0.29.0.gfm.6-6ubuntu0.24.04.1~esm1 0.29.0.gfm.6-6ubuntu0.24.04.1~esm1 Fixed
ubuntu/cmark-gfm(Ubuntu Pro 20.04) < 0.29.0.gfm.0-4ubuntu0.1~esm1; = 0.28.3.gfm.20-3; = 0.29.0.gfm.0-3; = 0.29.0.gfm.0-4 0.29.0.gfm.0-4ubuntu0.1~esm1 Fixed
ubuntu/cmark-gfm(Ubuntu Pro 22.04) < 0.29.0.gfm.3-3ubuntu0.1~esm1; = 0.29.0.gfm.0-6; = 0.29.0.gfm.2-1; = 0.29.0.gfm.2-1+really.0.29.0.gfm.0ubuntu1 +2 more 0.29.0.gfm.3-3ubuntu0.1~esm1 Fixed
ubuntu/cmark-gfm(Ubuntu Pro 24.04) < 0.29.0.gfm.6-6ubuntu0.24.04.1~esm1; = 0.29.0.gfm.6-6; = 0.29.0.gfm.6-6build1 0.29.0.gfm.6-6ubuntu0.24.04.1~esm1 Fixed

Affected products

ProductAffected versionsFixed in
debian/cmark-gfm(Debian:12) All versions No fix listed
debian/cmark-gfm(Debian:12) = 0.29.0.gfm.13-1 No fix listed
debian/cmark-gfm(Debian:12) = 0.29.0.gfm.13-2 No fix listed
debian/cmark-gfm(Debian:12) = 0.29.0.gfm.13-3 No fix listed
debian/cmark-gfm(Debian:12) = 0.29.0.gfm.13-4 No fix listed
debian/cmark-gfm(Debian:12) = 0.29.0.gfm.13-7 No fix listed
debian/cmark-gfm(Debian:12) = 0.29.0.gfm.13-7.1 No fix listed
debian/cmark-gfm(Debian:12) = 0.29.0.gfm.6-6 No fix listed
debian/cmark-gfm(Debian:13) < 0.29.0.gfm.13-1 0.29.0.gfm.13-1
debian/cmark-gfm(Debian:14) < 0.29.0.gfm.13-1 0.29.0.gfm.13-1
debian/python-cmarkgfm(Debian:12) All versions No fix listed
debian/python-cmarkgfm(Debian:12) = 0.8.0-3 No fix listed
debian/python-cmarkgfm(Debian:12) = 2024.11.20-1 No fix listed
debian/python-cmarkgfm(Debian:12) = 2025.10.22-1 No fix listed
debian/python-cmarkgfm(Debian:12) = 2025.10.22-2 No fix listed
debian/python-cmarkgfm(Debian:13) < 2024.11.20-1 2024.11.20-1
debian/python-cmarkgfm(Debian:14) < 2024.11.20-1 2024.11.20-1
debian/r-cran-commonmark(Debian:12) All versions No fix listed
debian/r-cran-commonmark(Debian:12) = 1.8.1-1 No fix listed
debian/r-cran-commonmark(Debian:12) = 1.9.0-1 No fix listed
debian/r-cran-commonmark(Debian:12) = 1.9.1-1 No fix listed
debian/r-cran-commonmark(Debian:12) = 1.9.2-1 No fix listed
debian/r-cran-commonmark(Debian:12) = 1.9.2-2 No fix listed
debian/r-cran-commonmark(Debian:12) = 1.9.5-1 No fix listed
debian/r-cran-commonmark(Debian:12) = 2.0.0-1 No fix listed
Show 55 more
ProductAffected versionsFixed in
debian/r-cran-commonmark(Debian:12) = 2.0.0-2 No fix listed
debian/r-cran-commonmark(Debian:12) = 2.0.0-3 No fix listed
debian/r-cran-commonmark(Debian:13) < 1.9.1-1 1.9.1-1
debian/r-cran-commonmark(Debian:14) < 1.9.1-1 1.9.1-1
debian/ruby-commonmarker(Debian:12) All versions No fix listed
debian/ruby-commonmarker(Debian:12) = 0.23.10-1 No fix listed
debian/ruby-commonmarker(Debian:12) = 0.23.6-1 No fix listed
debian/ruby-commonmarker(Debian:12) = 0.23.9-1 No fix listed
debian/ruby-commonmarker(Debian:12) = 2.10.0-1 No fix listed
debian/ruby-commonmarker(Debian:12) = 2.10.0-2 No fix listed
debian/ruby-commonmarker(Debian:12) = 2.10.1-1 No fix listed
debian/ruby-commonmarker(Debian:12) = 2.8.3-1 No fix listed
debian/ruby-commonmarker(Debian:12) = 2.8.3-2 No fix listed
debian/ruby-commonmarker(Debian:12) = 2.8.3-3 No fix listed
debian/ruby-commonmarker(Debian:12) = 2.8.3-4 No fix listed
debian/ruby-commonmarker(Debian:13) < 0.23.10-1 0.23.10-1
debian/ruby-commonmarker(Debian:14) < 0.23.10-1 0.23.10-1
GitHub cmark-gfm = < 0.29.0.gfm.10 No fix listed
ubuntu/cmark(Ubuntu:22.04) All versions No fix listed
ubuntu/cmark-gfm(Ubuntu:22.04) < 0.29.0.gfm.3-3ubuntu0.1~esm1 0.29.0.gfm.3-3ubuntu0.1~esm1
GitHub cmark-gfm < 0.29.0.gfm.10 0.29.0.gfm.10
ubuntu/cmark(Ubuntu:24.04) All versions No fix listed
ubuntu/cmark-gfm(Ubuntu:24.04) < 0.29.0.gfm.6-6ubuntu0.24.04.1~esm1 0.29.0.gfm.6-6ubuntu0.24.04.1~esm1
ubuntu/cmark(Ubuntu:26.04) All versions No fix listed
ubuntu/cmark(Ubuntu:26.10) All versions No fix listed
ubuntu/cmark(Ubuntu:18.04) All versions No fix listed
ubuntu/cmark(Ubuntu:18.04) = 0.26.1-1 No fix listed
ubuntu/cmark(Ubuntu:20.04) All versions No fix listed
ubuntu/cmark(Ubuntu:20.04) = 0.28.3-1 No fix listed
ubuntu/cmark(Ubuntu:20.04) = 0.29.0-1ubuntu2 No fix listed
ubuntu/cmark(Ubuntu:20.04) = 0.29.0-2 No fix listed
ubuntu/cmark-gfm(Ubuntu:Pro:20.04) < 0.29.0.gfm.0-4ubuntu0.1~esm1 0.29.0.gfm.0-4ubuntu0.1~esm1
ubuntu/cmark-gfm(Ubuntu:Pro:20.04) = 0.28.3.gfm.20-3 No fix listed
ubuntu/cmark-gfm(Ubuntu:Pro:20.04) = 0.29.0.gfm.0-3 No fix listed
ubuntu/cmark-gfm(Ubuntu:Pro:20.04) = 0.29.0.gfm.0-4 No fix listed
ubuntu/cmark(Ubuntu:22.04) = 0.29.0-4 No fix listed
ubuntu/cmark(Ubuntu:22.04) = 0.30.2-3 No fix listed
ubuntu/cmark(Ubuntu:22.04) = 0.30.2-4 No fix listed
ubuntu/cmark(Ubuntu:22.04) = 0.30.2-5 No fix listed
ubuntu/cmark-gfm(Ubuntu:Pro:22.04) < 0.29.0.gfm.3-3ubuntu0.1~esm1 0.29.0.gfm.3-3ubuntu0.1~esm1
ubuntu/cmark-gfm(Ubuntu:Pro:22.04) = 0.29.0.gfm.0-6 No fix listed
ubuntu/cmark-gfm(Ubuntu:Pro:22.04) = 0.29.0.gfm.2-1 No fix listed
ubuntu/cmark-gfm(Ubuntu:Pro:22.04) = 0.29.0.gfm.2-1+really.0.29.0.gfm.0ubuntu1 No fix listed
ubuntu/cmark-gfm(Ubuntu:Pro:22.04) = 0.29.0.gfm.2-2 No fix listed
ubuntu/cmark-gfm(Ubuntu:Pro:22.04) = 0.29.0.gfm.3-3 No fix listed
ubuntu/cmark(Ubuntu:24.04) = 0.30.2-6 No fix listed
ubuntu/cmark(Ubuntu:24.04) = 0.30.2-6build1 No fix listed
ubuntu/cmark-gfm(Ubuntu:Pro:24.04) < 0.29.0.gfm.6-6ubuntu0.24.04.1~esm1 0.29.0.gfm.6-6ubuntu0.24.04.1~esm1
ubuntu/cmark-gfm(Ubuntu:Pro:24.04) = 0.29.0.gfm.6-6 No fix listed
ubuntu/cmark-gfm(Ubuntu:Pro:24.04) = 0.29.0.gfm.6-6build1 No fix listed
ubuntu/cmark(Ubuntu:25.10) All versions No fix listed
ubuntu/cmark(Ubuntu:25.10) = 0.30.2-6build1 No fix listed
ubuntu/cmark(Ubuntu:26.10) = 0.30.2-6build2 No fix listed
ubuntu/cmark(Ubuntu:26.04) = 0.30.2-6build1 No fix listed
ubuntu/cmark(Ubuntu:26.04) = 0.30.2-6build2 No fix listed

References