CVE-2024-22051 is a critical-severity (CVSS 9.8) CWE-190 vulnerability in commonmarker. A fix is available for commonmarker — see the affected versions and patch details below.
CommonMarker Integer Overflow Vulnerability
Exploitation Status
No confirmed exploitation observed yet
- A successful exploit gives an attacker total control of the affected component, not partial access.
- CISA’s own triage has not observed active exploitation or public proof-of-concept code for this CVE as of its last assessment.
Exploitation and automatability from CISA’s SSVC triage for CVE-2024-22051.
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
How urgent is this, really
CVE-2024-22051 by exploitation likelihood (EPSS) against impact (CVSS). Outside the shaded patch-first corner.
Where this sits among everything scored
Of 385,386 CVEs with a current EPSS score, this one falls in the < 10% band (highlighted). Counts from FIRST.org, log-scaled.
Real-World Exposure
commonmarkerReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects RubyGems packages — download data is not available via public APIs for these ecosystems.
Description
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 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
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
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 💎RubyGems | commonmarker | all versions | 0.23.4bundle update commonmarker --conservative |
Affected Products
cmark-gfmgithubcommonmarkergjtorikianDetection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for commonmarker, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update commonmarker to 0.23.4 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2024-22051 is resolved across your whole dependency graph.
Workarounds
Stop feeding it untrusted input: reject or quarantine files and payloads from unverified sources until you can upgrade, restrict accepted formats to the ones you actually need, and run the parsing or decoding step in a least-privileged sandbox or short-lived worker so a crash or corrupted read cannot reach the rest of the process.
Fixing This On Your OS
If you run this on a Linux distribution, patch through your package manager against the distro's own security advisory below — it tracks the exact backported fix for your release, which can ship on a different timeline (and sometimes a different severity) than the upstream project.
The way the commonmarker gem is used in API Management Platform, doesn't allow for any significant crossing of security boundaries.
Disabling any use of the table extension of cmark-gfm will prevent this vulnerability from being triggered.Source: Red Hat security advisory for CVE-2024-22051 (CC BY 4.0)
Frequently Asked Questions
Is CVE-2024-22051 in your dependencies?
Find it across RubyGems, including transitive dependencies.