Description
cmark-gfm is GitHub's fork of cmark, a CommonMark parsing and rendering library and program in C. In versions prior to 0.29.0.gfm.6 a polynomial time complexity issue in cmark-gfm's autolink extension may lead to unbounded resource exhaustion and subsequent denial of service. Users may verify the patch by running `python3 -c 'print("![l"* 100000 + "\n")' | ./cmark-gfm -e autolink`, which will resource exhaust on unpatched cmark-gfm but render correctly on patched cmark-gfm. This vulnerability has been patched in 0.29.0.gfm.6. Users are advised to upgrade. Users unable to upgrade should disable the use of the autolink extension.
Affected products
| Vendor | Product | Affected | Fixed |
|---|---|---|---|
| github | cmark-gfm | < 0.29.0.gfm.6 | — |
Fixed in Linux distributions
Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.
Debian
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian 14 | cmark-gfm | 0.29.0.gfm.6-2 | — |
| Debian 14 | ghostwriter | 2.1.6+ds-1 | — |
| Debian 14 | python-cmarkgfm | 2024.11.20-1 | — |
| Debian 14 | r-cran-commonmark | 1.8.1-1 | — |
| Debian 14 | ruby-commonmarker | 0.23.10-1 | — |
| Debian 13 | cmark-gfm | 0.29.0.gfm.6-2 | — |
| Debian 13 | ghostwriter | 2.1.6+ds-1 | — |
| Debian 13 | python-cmarkgfm | 2024.11.20-1 | — |
| Debian 13 | r-cran-commonmark | 1.8.1-1 | — |
| Debian 13 | ruby-commonmarker | 0.23.10-1 | — |
| Debian 12 | cmark-gfm | 0.29.0.gfm.6-2 | — |
| Debian 12 | ghostwriter | 2.1.6+ds-1 | — |
| Debian 12 | python-cmarkgfm +1 | No fix yet | — |
| Debian 12 | r-cran-commonmark | 1.8.1-1 | — |
Ubuntu
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu Pro 24.04 LTS | cmark-gfm | 0.29.0.gfm.6-6ubuntu0.24.04.1~esm1 | USN-7319-1 |
| Ubuntu Pro 22.04 LTS | cmark-gfm | 0.29.0.gfm.3-3ubuntu0.1~esm1 | USN-7319-1 |
| Ubuntu Pro 20.04 LTS | cmark-gfm | 0.29.0.gfm.0-4ubuntu0.1~esm1 | USN-7319-1 |
Advisories 2
- USN-7319-1 cmark-gfm vulnerabilities Ubuntu Security Notices (USN) · Apr 27, 2026
- WID-SEC-2022-1935 Microsoft GitHub Enterprise: Mehrere Schwachstellen BSI CERT-Bund (WID) · Apr 2, 2023
References
- https://github.com/github/cmark-gfm/security/advisories/GHSA-cgh3-p57x-9q7q
- https://github.com/github/cmark-gfm/commit/9d57d8a23142b316282bdfc954cb0ecda40a8655
- https://en.wikipedia.org/wiki/Time_complexity
- FEDORA-2022-6bcee2cc93 vendor-advisory
- FEDORA-2022-f1aed93db8 vendor-advisory
- FEDORA-2022-dc6d6d9d6c vendor-advisory