CVE-2022-24724Integer overflow in table parsing extension leads to heap memory corruption
cmark-gfm is GitHub's extended version of the C reference implementation of CommonMark. Prior to versions 0.29.0.gfm.3 and 0.28.3.gfm.21, an integer overflow in cmark-gfm's table row parsing `table.c:row_from_string` may lead to heap memory corruption when parsing tables who's marker rows contain more than UINT16_MAX columns. The impact of this heap corruption ranges from Information Leak to Arbitrary Code Execution depending on how and where `cmark-gfm` is used. If `cmark-gfm` is used for rendering remote user controlled markdown, this vulnerability may lead to Remote Code Execution (RCE) in applications employing affected versions of the `cmark-gfm` library. This vulnerability has been patched in the following cmark-gfm versions 0.29.0.gfm.3 and 0.28.3.gfm.21. A workaround is available. The vulnerability exists in the table markdown extensions of cmark-gfm. Disabling the table extension will prevent this vulnerability from being triggered.
What to do
Fixed builds are available from AlmaLinux, Debian, Red Hat, Rocky Linux: see the table below for the fixed version per release.
Ubuntu has 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 20.04 | cmark-gfm | Fix pending | UBUNTU-CVE-2022-24724 | |
| Debian 14 | cmark-gfm | Fixed | 0.29.0.gfm.3-3 | DEBIAN-CVE-2022-24724 |
| Debian 14 | ghostwriter | Fixed | 2.1.6+ds-1 | DEBIAN-CVE-2022-24724 |
| Debian 14 | python-cmarkgfm | Fixed | 0.7.0-1 | DEBIAN-CVE-2022-24724 |
| Debian 14 | r-cran-commonmark | Fixed | 1.8.0-1 | DEBIAN-CVE-2022-24724 |
| Debian 14 | ruby-commonmarker | Fixed | 0.23.4-1 | DEBIAN-CVE-2022-24724 |
| Debian 13 | cmark-gfm | Fixed | 0.29.0.gfm.3-3 | DEBIAN-CVE-2022-24724 |
| Debian 13 | ghostwriter | Fixed | 2.1.6+ds-1 | DEBIAN-CVE-2022-24724 |
| Debian 13 | python-cmarkgfm | Fixed | 0.7.0-1 | DEBIAN-CVE-2022-24724 |
| Debian 13 | r-cran-commonmark | Fixed | 1.8.0-1 | DEBIAN-CVE-2022-24724 |
| Debian 13 | ruby-commonmarker | Fixed | 0.23.4-1 | DEBIAN-CVE-2022-24724 |
| Debian 12 | cmark-gfm | Fixed | 0.29.0.gfm.3-3 | DEBIAN-CVE-2022-24724 |
| Debian 12 | ghostwriter | Fixed | 2.1.6+ds-1 | DEBIAN-CVE-2022-24724 |
| Debian 12 | python-cmarkgfm | Fixed | 0.7.0-1 | DEBIAN-CVE-2022-24724 |
| Debian 12 | r-cran-commonmark | Fixed | 1.8.0-1 | DEBIAN-CVE-2022-24724 |
| Debian 12 | ruby-commonmarker | Fixed | 0.23.4-1 | DEBIAN-CVE-2022-24724 |
| Red Hat Enterprise Linux 8 | pandoc | Fixed | 0:2.0.6-6.el8_6 | RHSA-2022:5597 |
| Red Hat Enterprise Linux 8 | pandoc-common | Fixed | 0:2.0.6-6.el8_6 | RHSA-2022:5597 |
| AlmaLinux 8 | pandoc | Fixed | 2.0.6-6.el8_6 | ALSA-2022:5597 |
| AlmaLinux 8 | pandoc-common | Fixed | 2.0.6-6.el8_6 | ALSA-2022:5597 |
| Rocky Linux 8 | pandoc | Fixed | 0:2.0.6-6.el8_6 | RLSA-2022:5597 |
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.28.3.gfm.21, >= 0.29.0.gfm.0, < 0.29.0.gfm.3
Vendor advisories:
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/… (vendor-advisory)
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/… (vendor-advisory)
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/… (vendor-advisory)
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/… (vendor-advisory)
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/… (vendor-advisory)
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/… (vendor-advisory)
References
- https://github.com/github/cmark-gfm/security/advisories/GHSA-mc3g-88wq-6f4x
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/Z55K6VNVKO2G5SNKRCQ2KDG5SKTX5PVV/
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/TJBFIJEHJZEEDG6MO4MQHZYKUXELH77O/
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/F7V3HAM5H6YFJG2QFEXACZR3XVWFTXTC/
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/5CYUU662VO6CCXQKVZVOHXX3RGIF2DLQ/
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/RSKUOJ2VAYGTJXPDE2RRPMNLVVMKCI77/
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/KH4UQA6VWVZU5EW3HNEAB7D7BTCNJSJ2/
- http://packetstormsecurity.com/files/166599/cmark-gfm-Integer-overflow.html
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.