Skip to main content
Press slash or control plus K to focus the search. Use the arrow keys to navigate results and press enter to open a threat.
Reconnecting to live updates…

CVE-2022-24724: CWE-190: Integer Overflow or Wraparound in github cmark-gfm

0
Medium
Published: Thu Mar 03 2022 (03/03/2022, 19:35:09 UTC)
Source: CVE
Vendor/Project: github
Product: cmark-gfm

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.

AI-Powered Analysis

AILast updated: 06/22/2025, 03:04:59 UTC

Technical Analysis

CVE-2022-24724 is a medium-severity vulnerability affecting cmark-gfm, GitHub's extended C implementation of the CommonMark markdown parser. The flaw is an integer overflow (CWE-190) occurring in the table row parsing function `row_from_string` within the table markdown extension. Specifically, when parsing tables whose marker rows contain more than UINT16_MAX (65,535) columns, an integer overflow can occur. This overflow leads to heap memory corruption, which depending on the context of usage, can result in a range of impacts from information disclosure to arbitrary code execution. The vulnerability arises because the integer overflow causes incorrect memory allocation or indexing, corrupting heap structures. Applications that use vulnerable versions of cmark-gfm to render markdown content, especially if that content is user-controlled and remote, are at risk of remote code execution (RCE). The affected versions are those prior to 0.28.3.gfm.21 and versions from 0.29.0.gfm.0 up to but not including 0.29.0.gfm.3. The vulnerability has been patched in versions 0.28.3.gfm.21 and 0.29.0.gfm.3. As a workaround, disabling the table extension in cmark-gfm prevents exploitation by eliminating the vulnerable code path. No known exploits have been reported in the wild as of the publication date. The vulnerability is particularly relevant for applications that process markdown with tables containing very large numbers of columns, which is uncommon but possible in certain automated or maliciously crafted inputs.

Potential Impact

For European organizations, the impact of this vulnerability depends largely on the use of cmark-gfm within their software stacks. Organizations that use cmark-gfm to render markdown content from untrusted or remote sources—such as collaborative platforms, content management systems, or developer tools—face a risk of remote code execution, which could lead to full system compromise. This could result in data breaches, service disruptions, or lateral movement within networks. Information leakage due to heap corruption could expose sensitive data. The vulnerability's exploitation requires specially crafted markdown tables with an extremely high number of columns, which may limit widespread exploitation but does not eliminate risk, especially in targeted attacks. The potential for RCE elevates the threat to critical infrastructure and enterprises handling sensitive data, including financial institutions, healthcare providers, and government agencies in Europe. Additionally, the presence of this vulnerability in open-source libraries used in internal or third-party applications increases the attack surface. Given the lack of known exploits, the immediate risk may be moderate, but the potential impact of successful exploitation is high.

Mitigation Recommendations

European organizations should take the following specific actions: 1) Inventory all software and services that incorporate cmark-gfm, including indirect dependencies in development tools, CI/CD pipelines, and content rendering engines. 2) Upgrade all instances of cmark-gfm to versions 0.28.3.gfm.21 or later, or 0.29.0.gfm.3 or later, where the vulnerability is patched. 3) If immediate upgrade is not feasible, disable the table markdown extension in cmark-gfm to prevent triggering the vulnerable code path. 4) Implement input validation and sanitization on markdown content, limiting the number of columns in tables to below UINT16_MAX to reduce risk. 5) Monitor logs and application behavior for anomalous markdown parsing errors or crashes that could indicate exploitation attempts. 6) Engage with third-party vendors to ensure their products using cmark-gfm are updated. 7) Incorporate this vulnerability into threat modeling and penetration testing to assess exposure. 8) Educate developers and security teams about the risks of integer overflows and the importance of patching open-source dependencies promptly.

Need more detailed analysis?Upgrade to Pro Console

Technical Details

Data Version
5.1
Assigner Short Name
GitHub_M
Date Reserved
2022-02-10T00:00:00.000Z
Cisa Enriched
true

Threat ID: 682d9848c4522896dcbf62da

Added to database: 5/21/2025, 9:09:28 AM

Last enriched: 6/22/2025, 3:04:59 AM

Last updated: 2/7/2026, 4:18:00 PM

Views: 36

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

Need more coverage?

Upgrade to Pro Console in Console -> Billing for AI refresh and higher limits.

For incident response and remediation, OffSeq services can help resolve threats faster.

Latest Threats