CVE-2023-26485Quadratic complexity may lead to a denial of service in cmark-gfm
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)
What to do
Fixed builds are available from Debian: see the table below for the fixed version per release.
Debian, Ubuntu have not shipped a fix for every release yet.
Is your server affected? One read-only command checks every installed package against this CVE and all others, using each vendor's fixed versions. Get started or get a free API key.
curl -sS "https://api.cvefocus.com/v1/check?format=text" -H "Authorization: Bearer $CVEFOCUS_KEY" \ -H "Content-Type: text/plain" --data-binary @inventory.txt
Vendor status at a glance
Status by vendor and release
From each vendor's own security data and VEX statements. "Fixed" means a fixed build is published for that release.
| Release | Package | Status | Fixed version | Advisory |
|---|---|---|---|---|
| Ubuntu 26.10 | cmark | Fix pending | UBUNTU-CVE-2023-26485 | |
| Ubuntu 26.04 | cmark | Under investigation | UBUNTU-CVE-2023-26485 | |
| Ubuntu 26.04 | cmark-gfm | Not affected vulnerable_code_not_present | ||
| Ubuntu 25.10 | cmark | Will not fix Ubuntu decided not to fix this in this release | UBUNTU-CVE-2023-26485 | |
| Ubuntu 25.10 | cmark-gfm | Not affected vulnerable_code_not_present | ||
| Ubuntu 24.04 | cmark | Under investigation | UBUNTU-CVE-2023-26485 | |
| Ubuntu 24.04 | cmark-gfm | Fix pending | 0.29.0.gfm.6-6ubuntu0.24.04.1~esm1 (Ubuntu Pro) | UBUNTU-CVE-2023-26485 |
| Ubuntu 22.04 | cmark | Under investigation | UBUNTU-CVE-2023-26485 | |
| Ubuntu 22.04 | cmark-gfm | Fix pending | 0.29.0.gfm.3-3ubuntu0.1~esm1 (Ubuntu Pro) | UBUNTU-CVE-2023-26485 |
| Ubuntu 20.04 | cmark | Will not fix Ubuntu decided not to fix this in this release | UBUNTU-CVE-2023-26485 | |
| Ubuntu 20.04 | cmark-gfm | Fix pending | 0.29.0.gfm.0-4ubuntu0.1~esm1 (Ubuntu Pro) | UBUNTU-CVE-2023-26485 |
| Ubuntu 18.04 | cmark | Will not fix Ubuntu decided not to fix this in this release | UBUNTU-CVE-2023-26485 | |
| Debian 14 | cmark-gfm | Fixed | 0.29.0.gfm.13-1 | DEBIAN-CVE-2023-26485 |
| Debian 14 | python-cmarkgfm | Fixed | 2024.11.20-1 | DEBIAN-CVE-2023-26485 |
| Debian 14 | r-cran-commonmark | Fixed | 1.9.1-1 | DEBIAN-CVE-2023-26485 |
| Debian 14 | ruby-commonmarker | Fixed | 0.23.10-1 | DEBIAN-CVE-2023-26485 |
| Debian 13 | cmark-gfm | Fixed | 0.29.0.gfm.13-1 | DEBIAN-CVE-2023-26485 |
| Debian 13 | python-cmarkgfm | Fixed | 2024.11.20-1 | DEBIAN-CVE-2023-26485 |
| Debian 13 | r-cran-commonmark | Fixed | 1.9.1-1 | DEBIAN-CVE-2023-26485 |
| Debian 13 | ruby-commonmarker | Fixed | 0.23.10-1 | DEBIAN-CVE-2023-26485 |
| Debian 12 | cmark-gfm | Fix pending | DEBIAN-CVE-2023-26485 | |
| Debian 12 | python-cmarkgfm | Fix pending | DEBIAN-CVE-2023-26485 | |
| Debian 12 | r-cran-commonmark | Fix pending | DEBIAN-CVE-2023-26485 | |
| Debian 12 | ruby-commonmarker | Fix pending | DEBIAN-CVE-2023-26485 |
What the vendor says
As published in the CVE record by GitHub_M, the CVE's assigner (usually the vendor). Check the vendor's advisory before acting.
- github cmark-gfm: affected: < 0.29.0.gfm.10
References
- https://github.com/github/cmark-gfm/security/advisories/GHSA-r8vr-c48j-fcc5
- https://github.com/github/cmark-gfm/commit/07a66c9bc341f902878e37d7da8647d6ef150987
About this page
Compiled by CVEfocus from the CVE List, the security data and VEX statements of Ubuntu, Debian, Red Hat, AlmaLinux, Rocky Linux and Microsoft, CISA's Known Exploited Vulnerabilities catalog and FIRST EPSS, refreshed several times a day (data status). Information only; see the disclaimer. Official record: cve.org · NVD.