CVE-2023-24824
JSON

5.3medium

Quadratic complexity may lead to a denial of service in cmark-gfm

Severity
5.3medium CVSS:3.1 by GitHub_M
Exploit likelihood
1.03% (higher than 64% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
HSEC-2025-0007GHSA-66g8-4hjf-77xh

Description

cmark-gfm is GitHub's fork of cmark, a CommonMark parsing and rendering library and program in C. A polynomial time complexity issue in cmark-gfm may lead to unbounded resource exhaustion and subsequent denial of service. This CVE covers quadratic complexity issues when parsing text which leads with either large numbers of `>` or `-` characters. This issue has been addressed in version 0.29.0.gfm.10. Users are advised to upgrade. Users unable to upgrade should validate that their input comes from trusted sources.

Affected

Product or packageVersionsReported by
github cmark-gfm< 0.29.0.gfm.10, before 0.29.0.gfm.10.CVE List, NVD
cmark-gfm (Hackage)from 0.1.0 before 0.2.6Haskell Security Advisories

All scores

GitHub_M5.3medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
NVD7.5high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

Classification

CWE-400CWE-407

SSVC (CISA-ADP): exploitation poc, automatable yes, technical impact partial.

What each source says

CVE List

cmark-gfm is GitHub's fork of cmark, a CommonMark parsing and rendering library and program in C. A polynomial time complexity issue in cmark-gfm may lead to unbounded resource exhaustion and subsequent denial of service. This CVE covers quadratic complexity issues when parsing text which leads with either large numbers of `>` or `-` characters. This issue has been addressed in version 0.29.0.gfm.10. Users are advised to upgrade. Users unable to upgrade should validate that their input comes from trusted sources.

Haskell Security Advisories

cmark-gfm: resource exhaustion due to quadratic complexity in parser

cmark-gfm is GitHub's fork of cmark, a CommonMark parsing and rendering library and program in C. A polynomial time complexity issue in cmark-gfm may lead to unbounded resource exhaustion and subsequent denial of service, due to quadratic complexity issues when parsing text which leads with either large numbers of > or - characters.

The Haskell cmark-gfm package bundles the C sources and was affected by this issue. This fix was released in the upstream C package at version 0.29.0.gfm.10. Version 0.2.6 of the Haskell package adopted the fix (moving from 0.29.0.gfm.6 to 0.29.0.gfm.13). Packages that depend on cmark-gfm should update to 0.2.6 or later.

Users unable to update should avoid processing data from untrusted sources or validate the input with other tools before using cmark-gfm to parse it.

Pandoc < 2.10.1 depended on cmark-gfm and could be affected by this issue.

References

Sources

SourceRecordLicence
CVE ListCVE-2023-24824 changed 2025-02-11CVE Terms of Use
Haskell Security AdvisoriesHSEC-2025-0007 changed 2025-12-27CC0-1.0
NVDCVE-2023-24824 changed 2026-06-17Public domain