Bug 2256887 (CVE-2024-22051)

Summary: CVE-2024-22051 commonmarker: integer overflow in cmark-gfm's table row parsing may lead to heap memory corruption
Product: [Other] Security Response Reporter: Robb Gatica <rgatica>
Component: vulnerabilityAssignee: Product Security <prodsec-ir-bot>
Status: NEW --- QA Contact:
Severity: high Docs Contact:
Priority: high    
Version: unspecifiedCC: amasferr, carnil, chazlett, mkudlej, tjochec
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: commonmarker 0.23.4 Doc Type: If docs needed, set a value
Doc Text:
An integer overflow in cmark-gfm's table row parsing may lead to heap memory corruption when parsing tables who's marker rows contain more than UINT16_MAX columns.
Story Points: ---
Clone Of: Environment:
Last Closed: Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 2256885    

Description Robb Gatica 2024-01-05 00:38:01 UTC
Description:
CommonMarker uses cmark-gfm for rendering Github Flavored Markdown. An integer overflow in cmark-gfm's table row parsing 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. If affected versions of CommonMarker are used for rendering remote user controlled markdown, this vulnerability may lead to Remote Code Execution (RCE).

Patches:
This vulnerability has been patched in the following CommonMarker release: v0.23.4

Workarounds:
The vulnerability exists in the table markdown extensions of cmark-gfm. Disabling any use of the table extension will prevent this vulnerability from being triggered.

References:
https://github.com/advisories/GHSA-fmx4-26r3-wxpf
https://github.com/github/cmark-gfm/security/advisories/GHSA-mc3g-88wq-6f4x
https://github.com/gjtorikian/commonmarker/commit/ab4504fd17460627a6ab255bc3c63e8e5fc6aed3
https://github.com/gjtorikian/commonmarker/security/advisories/GHSA-fmx4-26r3-wxpf
https://vulncheck.com/advisories/vc-advisory-GHSA-fmx4-26r3-wxpf

Comment 4 Salvatore Bonaccorso 2024-01-05 07:02:46 UTC
Is this not yet covered already by CVE-2022-24724 (cmark-gfm), given ruby-commonmarker just embbeds cmark-gfm and fixes the issue with the 0.23.4 version importing/rebasing the cmark-gfm version?

Comment 5 Robb Gatica 2024-01-10 00:46:25 UTC
I'm inclined to agree that this may be duplicate issue of cmark-gfm - CVE-2022-24724. VulnCheck apparently pulled the new CVE for CommonMarker.