Skip to content

CVE-2022-24724 Integer overflow in table parsing extension leads to heap memory corruption

CriticalCVSS 9.8 EPSS 4.5%
Published
Updated
Exploit status
No public exploit known
CISA SSVC
Proof of concept public · automatable: no · technical impact: total
Technology
UbuntuDebian

Description

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.

Upgrade path

18 packages: 16 fixed, 1 with no fix yet.

PackageAffectedFixed inStatus
ubuntu/cmark-gfm(Ubuntu Pro 20.04) = 0.28.3.gfm.20-3; = 0.29.0.gfm.0-3; = 0.29.0.gfm.0-4; = 0.29.0.gfm.0-4ubuntu0.1~esm1 +1 more No fix listed No fix yet
debian/cmark-gfm(Debian 12) < 0.29.0.gfm.3-3 0.29.0.gfm.3-3 Fixed
debian/cmark-gfm(Debian 13) < 0.29.0.gfm.3-3 0.29.0.gfm.3-3 Fixed
debian/cmark-gfm(Debian 14) < 0.29.0.gfm.3-3 0.29.0.gfm.3-3 Fixed
debian/ghostwriter(Debian 12) < 2.1.6+ds-1 2.1.6+ds-1 Fixed
debian/ghostwriter(Debian 13) < 2.1.6+ds-1 2.1.6+ds-1 Fixed
debian/ghostwriter(Debian 14) < 2.1.6+ds-1 2.1.6+ds-1 Fixed
debian/python-cmarkgfm(Debian 12) < 0.7.0-1 0.7.0-1 Fixed
debian/python-cmarkgfm(Debian 13) < 0.7.0-1 0.7.0-1 Fixed
debian/python-cmarkgfm(Debian 14) < 0.7.0-1 0.7.0-1 Fixed
debian/r-cran-commonmark(Debian 12) < 1.8.0-1 1.8.0-1 Fixed
debian/r-cran-commonmark(Debian 13) < 1.8.0-1 1.8.0-1 Fixed
debian/r-cran-commonmark(Debian 14) < 1.8.0-1 1.8.0-1 Fixed
debian/ruby-commonmarker(Debian 12) < 0.23.4-1 0.23.4-1 Fixed
debian/ruby-commonmarker(Debian 13) < 0.23.4-1 0.23.4-1 Fixed
debian/ruby-commonmarker(Debian 14) < 0.23.4-1 0.23.4-1 Fixed
GitHub cmark-gfm < 0.28.3.gfm.21; = < 0.28.3.gfm.21; = >= 0.29.0.gfm.0, < 0.29.0.gfm.3; >= 0.28.3.gfm.21, < 0.29.0.gfm.3 0.28.3.gfm.21, 0.29.0.gfm.3 Fixed
fedoraproject fedora = 34; = 35; = 36 No fix listed Versions listed

Affected products

ProductAffected versionsFixed in
GitHub cmark-gfm = < 0.28.3.gfm.21 No fix listed
GitHub cmark-gfm = >= 0.29.0.gfm.0, < 0.29.0.gfm.3 No fix listed
GitHub cmark-gfm < 0.28.3.gfm.21 0.28.3.gfm.21
GitHub cmark-gfm >= 0.28.3.gfm.21, < 0.29.0.gfm.3 0.29.0.gfm.3
fedoraproject fedora = 34 No fix listed
fedoraproject fedora = 35 No fix listed
fedoraproject fedora = 36 No fix listed
debian/cmark-gfm(Debian:12) < 0.29.0.gfm.3-3 0.29.0.gfm.3-3
debian/cmark-gfm(Debian:14) < 0.29.0.gfm.3-3 0.29.0.gfm.3-3
debian/cmark-gfm(Debian:13) < 0.29.0.gfm.3-3 0.29.0.gfm.3-3
debian/ghostwriter(Debian:12) < 2.1.6+ds-1 2.1.6+ds-1
debian/ghostwriter(Debian:14) < 2.1.6+ds-1 2.1.6+ds-1
debian/ghostwriter(Debian:13) < 2.1.6+ds-1 2.1.6+ds-1
debian/python-cmarkgfm(Debian:12) < 0.7.0-1 0.7.0-1
debian/python-cmarkgfm(Debian:14) < 0.7.0-1 0.7.0-1
debian/python-cmarkgfm(Debian:13) < 0.7.0-1 0.7.0-1
debian/r-cran-commonmark(Debian:12) < 1.8.0-1 1.8.0-1
debian/r-cran-commonmark(Debian:14) < 1.8.0-1 1.8.0-1
debian/r-cran-commonmark(Debian:13) < 1.8.0-1 1.8.0-1
debian/ruby-commonmarker(Debian:12) < 0.23.4-1 0.23.4-1
debian/ruby-commonmarker(Debian:14) < 0.23.4-1 0.23.4-1
debian/ruby-commonmarker(Debian:13) < 0.23.4-1 0.23.4-1
ubuntu/cmark-gfm(Ubuntu:Pro:20.04) All versions No fix listed
ubuntu/cmark-gfm(Ubuntu:Pro:20.04) = 0.28.3.gfm.20-3 No fix listed
ubuntu/cmark-gfm(Ubuntu:Pro:20.04) = 0.29.0.gfm.0-3 No fix listed
Show 2 more
ProductAffected versionsFixed in
ubuntu/cmark-gfm(Ubuntu:Pro:20.04) = 0.29.0.gfm.0-4 No fix listed
ubuntu/cmark-gfm(Ubuntu:Pro:20.04) = 0.29.0.gfm.0-4ubuntu0.1~esm1 No fix listed

References