Name | CVE-2023-26485 |
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](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) |
Source | CVE (at NVD; CERT, LWN, oss-sec, fulldisc, Red Hat, Ubuntu, Gentoo, SUSE bugzilla/CVE, GitHub advisories/code/issues, web search, more) |
Debian Bugs | 1034171, 1034172, 1034173, 1034174 |
The table below lists information on source packages.
Source Package | Release | Version | Status |
---|---|---|---|
cmark-gfm (PTS) | bullseye | 0.29.0.gfm.0-6 | vulnerable |
bookworm | 0.29.0.gfm.6-6 | vulnerable | |
trixie, sid | 0.29.0.gfm.13-4 | fixed | |
python-cmarkgfm (PTS) | bullseye | 0.4.2-1 | vulnerable |
bookworm | 0.8.0-3 | vulnerable | |
trixie, sid | 2024.11.20-1 | fixed | |
r-cran-commonmark (PTS) | bullseye | 1.7-2 | vulnerable |
bookworm | 1.8.1-1 | vulnerable | |
trixie, sid | 1.9.5-1 | fixed | |
ruby-commonmarker (PTS) | bullseye | 0.21.0-1 | vulnerable |
bookworm | 0.23.6-1 | vulnerable | |
trixie, sid | 0.23.10-1 | fixed |
The information below is based on the following data on fixed versions.
Package | Type | Release | Fixed Version | Urgency | Origin | Debian Bugs |
---|---|---|---|---|---|---|
cmark-gfm | source | (unstable) | 0.29.0.gfm.13-1 | 1034171 | ||
python-cmarkgfm | source | (unstable) | 2024.11.20-1 | 1034172 | ||
r-cran-commonmark | source | (unstable) | 1.9.1-1 | 1034173 | ||
ruby-commonmarker | source | (unstable) | 0.23.10-1 | 1034174 |
[bookworm] - cmark-gfm <no-dsa> (Minor issue)
[bullseye] - cmark-gfm <no-dsa> (Minor issue)
[buster] - cmark-gfm <no-dsa> (Minor issue)
[bookworm] - python-cmarkgfm <no-dsa> (Minor issue)
[bullseye] - python-cmarkgfm <no-dsa> (Minor issue)
[buster] - python-cmarkgfm <no-dsa> (Minor issue)
[bookworm] - r-cran-commonmark <ignored> (Minor issue)
[bullseye] - r-cran-commonmark <no-dsa> (Minor issue)
[buster] - r-cran-commonmark <no-dsa> (Minor issue)
[bookworm] - ruby-commonmarker <ignored> (Minor issue)
[bullseye] - ruby-commonmarker <no-dsa> (Minor issue)
[buster] - ruby-commonmarker <no-dsa> (Minor issue)
https://github.com/github/cmark-gfm/security/advisories/GHSA-r8vr-c48j-fcc5
https://github.com/github/cmark-gfm/commit/07a66c9bc341f902878e37d7da8647d6ef150987 (0.29.0.gfm.10)
https://github.com/theacodes/cmarkgfm/commit/acf473a51a9dc3a4fd6d6a4b30e4d80c94d91d4a (2024.1.14)
r-cran-commonmark: https://github.com/r-lib/commonmark/commit/969e27ea29dce1c2d7ab9b9909640bb4643d460f (v1.9.1)