Vulnerabilities in pkg:gem/commonmarker
PACKAGECVE-2024-22051 is a HIGH (CVSS 8.8) integer overflow vulnerability (CWE-190: Integer Overflow or Wraparound) affecting Commonmarker libraries in the RubyGems ecosystem. The issue involves integer overflow in cmark-gfm table parsing extension leads to heap memory corruption. Remediation is available by upgrading affected packages to version 0.23.4.
pkg:gem/commonmarker
Vulnerability advisories affecting package pkg:gem/commonmarker. Select an advisory below to view technical details or fixes.
| Advisory ID | CVE / NVD | Severity | Summary |
|---|---|---|---|
| GHSA-fmx4-26r3-wxpf | CVE-2024-22051 | HIGH | Integer overflow in cmark-gfm table parsing extension leads to heap memory corruption |
| GHSA-c2v4-chx5-vff6 | - | HIGH | Duplicate Advisory: Integer overflow in cmark-gfm table parsing extension leads to heap memory corruption |
| GHSA-7vh7-fw88-wj87 | - | MODERATE | Several quadratic complexity bugs may lead to denial of service in Commonmarker |
| GHSA-48wp-p9qv-4j64 | - | MODERATE | Commonmarker vulnerable to to several quadratic complexity bugs that may lead to denial of service |
| GHSA-636f-xm5j-pj9m | - | MODERATE | Several quadratic complexity bugs may lead to denial of service in Commonmarker |
| GHSA-4qw4-jpp4-8gvp | - | MODERATE | Unbounded resource exhaustion in cmark-gfm autolink extension may lead to denial of service |
CVE-2024-22051 at a Glance
Security Impact
CVSS: 8.8
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H).
How to Fix CVE-2024-22051
To remediate this vulnerability, upgrade all affected Commonmarker dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade commonmarker to 0.23.4
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for commonmarker
How to Check if You Are Affected
To determine whether your application is affected by CVE-2024-22051, inspect your project dependencies for Commonmarker:
inspect dependencies for commonmarker
Analyze the terminal output to locate any version of Commonmarker in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.23.4), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-190: Integer Overflow or Wraparound, where the product performs a calculation that can produce an integer overflow or wraparound when the logic assumes that the resulting value will always be larger than the original value. this occurs when an integer value is incremented to a value that is too large to store in the associated representation. when this occurs, the value may become a very small or negative number. In Commonmarker, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2024-22051 Affected Commonmarker Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
commonmarker
|
RubyGems |
< 0.23.4
|
0.23.4
|
References
Frequently Asked Questions
What is CVE-2024-22051?
Which Commonmarker versions are affected?
What version fixes CVE-2024-22051?
Is commonmarker affected?
What is the CVSS score of CVE-2024-22051?
What CWE is associated with CVE-2024-22051?
How can I check RubyGems dependencies for CVE-2024-22051?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-fmx4-26r3-wxpf",
"modified" : "2026-05-14T20:48:53Z",
"published" : "2022-03-03T20:28:47Z",
"aliases" : [ "CVE-2024-22051" ],
"summary" : "Integer overflow in cmark-gfm table parsing extension leads to heap memory corruption",
"details" : "### Impact\n\nCommonMarker uses `cmark-gfm` for rendering [Github Flavored Markdown](https://github.github.com/gfm/). An [integer overflow in `cmark-gfm`'s table row parsing](https://github.com/github/cmark-gfm/security/advisories/GHSA-mc3g-88wq-6f4x) 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.\n\nIf affected versions of CommonMarker are used for rendering remote user controlled markdown, this vulnerability may lead to Remote Code Execution (RCE).\n\n### Patches\n\nThis vulnerability has been patched in the following CommonMarker release:\n\n- v0.23.4\n\n### Workarounds\n\nThe vulnerability exists in the table markdown extensions of `cmark-gfm`. Disabling any use of the table extension will prevent this vulnerability from being triggered.\n\n### References\n\n- https://github.com/github/cmark-gfm/security/advisories/GHSA-mc3g-88wq-6f4x\n\n### Acknowledgements\n\nWe would like to thank Felix Wilhelm of Google's Project Zero for reporting this vulnerability\n\n### For more information\n\nIf you have any questions or comments about this advisory:\n\n* Open an issue in [CommonMarker](http://github.com/gjtorikian/commonmarker)",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "RubyGems",
"name" : "commonmarker"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "0.23.4"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/github/cmark-gfm/security/advisories/GHSA-mc3g-88wq-6f4x"
}, {
"type" : "WEB",
"url" : "https://github.com/gjtorikian/commonmarker/security/advisories/GHSA-fmx4-26r3-wxpf"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-22051"
}, {
"type" : "WEB",
"url" : "https://github.com/gjtorikian/commonmarker/commit/ab4504fd17460627a6ab255bc3c63e8e5fc6aed3"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/gjtorikian/commonmarker"
}, {
"type" : "WEB",
"url" : "https://github.com/rubysec/ruby-advisory-db/blob/master/gems/commonmarker/CVE-2024-22051.yml"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-190" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2022-03-03T20:28:47Z",
"nvd_published_at" : null
}
}