CVE-2024-22051: CommonMarker Integer Overflow Vulnerability

Published Mar 3, 2022
·
Updated

Impact

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 UINT16MAX 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/github/cmark-gfm/security/advisories/GHSA-mc3g-88wq-6f4x

Acknowledgements

We would like to thank Felix Wilhelm of Google's Project Zero for reporting this vulnerability

For more information

If you have any questions or comments about this advisory:

Open an issue in CommonMarker

Other sources

CommonMarker versions prior to 0.23.4 are at risk of an integer overflow vulnerability. This vulnerability can result in possibly unauthenticated remote attackers to cause heap memory corruption, potentially leading to an information leak or remote code execution, via parsing tables with marker rows that contain more than UINT16MAX columns.

MITRE

Affected Software

4 affected componentsFixes available
rubygems/commonmarker<0.23.4
0.23.4
GitHub cmark-gfm<0.28.3.gfm.21
GitHub cmark-gfm>=0.29.0.gfm.0<0.29.0.gfm.3
gjtorikian Commonmarker Ruby<0.23.4

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade rubygems/commonmarker to a version that resolves this vulnerability.

    Fixed in 0.23.4
  2. Upgrade

    Upgrade CommonMarker to a version that resolves this vulnerability.

    Fixed in 0.23.4
  3. Configuration

    Disable the table markdown extension in cmark-gfm (via CommonMarker) so table parsing cannot be triggered.

    cmark-gfm (CommonMarker table markdown extension) table extension = disabled

Event History

Mar 3, 2022
Advisory Published
08:28 PM
Jan 4, 2024
CVE Published
via MITRE·08:27 PM
Data Sourced
via MITRE·08:27 PM
DescriptionWeakness
Data Sourced
via NVD·09:15 PM
RemedyDescriptionSeverityWeaknessAffected Software
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2024-22051?

CVE-2024-22051 has a high severity rating due to the potential for heap memory corruption.

2

How do I fix CVE-2024-22051?

To fix CVE-2024-22051, upgrade the cmark-gfm to version 0.28.3.gfm.21 or later, and commonmarker to version 0.23.4.

3

What software is affected by CVE-2024-22051?

The vulnerability CVE-2024-22051 affects commonmarker versions prior to 0.23.4 and cmark-gfm versions up to 0.28.3.gfm.21.

4

What type of vulnerability is CVE-2024-22051?

CVE-2024-22051 is an integer overflow vulnerability that can lead to heap memory corruption.

5

Who is responsible for the vulnerabilities in CVE-2024-22051?

The vulnerabilities in CVE-2024-22051 are associated with the GitHub projects cmark-gfm and commonmarker.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203