Vulnerability · Published Sep 15, 2022 · Assigned by GitHub_M
CVE-2022-39209Uncontrolled Resource Consumption in cmark-gfm
High 7.5
In plain English
A high-severity uncontrolled resource consumption in cmark-gfm from github. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 2.2% (higher than 82% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.
Official 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 packages & fixed versions
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian:12 | cmark-gfm | 0.29.0.gfm.6-2 | DEBIAN-CVE-2022-39209 |
| Debian:13 | cmark-gfm | 0.29.0.gfm.6-2 | DEBIAN-CVE-2022-39209 |
| Debian:14 | cmark-gfm | 0.29.0.gfm.6-2 | DEBIAN-CVE-2022-39209 |
| Debian:12 | ghostwriter | 2.1.6+ds-1 | DEBIAN-CVE-2022-39209 |
| Debian:13 | ghostwriter | 2.1.6+ds-1 | DEBIAN-CVE-2022-39209 |
| Debian:14 | ghostwriter | 2.1.6+ds-1 | DEBIAN-CVE-2022-39209 |
| Debian:12 | python-cmarkgfm | no fix listed | DEBIAN-CVE-2022-39209 |
| Debian:13 | python-cmarkgfm | 2024.11.20-1 | DEBIAN-CVE-2022-39209 |
| Debian:14 | python-cmarkgfm | 2024.11.20-1 | DEBIAN-CVE-2022-39209 |
| Debian:12 | r-cran-commonmark | 1.8.1-1 | DEBIAN-CVE-2022-39209 |
| Debian:13 | r-cran-commonmark | 1.8.1-1 | DEBIAN-CVE-2022-39209 |
| Debian:14 | r-cran-commonmark | 1.8.1-1 | DEBIAN-CVE-2022-39209 |
| Debian:12 | ruby-commonmarker | no fix listed | DEBIAN-CVE-2022-39209 |
| Debian:13 | ruby-commonmarker | 0.23.10-1 | DEBIAN-CVE-2022-39209 |
| Debian:14 | ruby-commonmarker | 0.23.10-1 | DEBIAN-CVE-2022-39209 |
Affected products (as reported)
Weakness: CWE-400 · Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
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