CVE-2022-24724: CWE-190: Integer Overflow or Wraparound in github cmark-gfm
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 Analysis
Technical Summary
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.
Affected Countries
Germany, France, United Kingdom, Netherlands, Sweden, Finland, Belgium, Italy
CVE-2022-24724: CWE-190: Integer Overflow or Wraparound in github 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
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.
Affected Countries
For access to advanced analysis and higher rate limits, contact root@offseq.com
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: 8/17/2025, 9:50:52 AM
Views: 19
Related Threats
CVE-2025-9341: CWE-400 Uncontrolled Resource Consumption in Legion of the Bouncy Castle Inc. Bouncy Castle for Java FIPS
MediumCVE-2025-8678: CWE-918 Server-Side Request Forgery (SSRF) in johnbillion WP Crontrol
MediumCVE-2025-57699: Unquoted search path or element in Western Digital Corporation Western Digital Kitfox for Windows
MediumCVE-2025-8281: CWE-79 Cross-Site Scripting (XSS) in WP Talroo
HighCVE-2025-41452: CWE-15: External Control of System or Configuration Setting in Danfoss AK-SM8xxA Series
MediumActions
Updates to AI analysis are available only with a Pro account. Contact root@offseq.com for access.
External Links
Need enhanced features?
Contact root@offseq.com for Pro access with improved analysis and higher rate limits.