Out-of-Bounds Read Vulnerability in cmark-gfm Package

cmark-gfm Updated 02 Oct 2025

Summary

24/01/2023
N/A
Yes i
Unrated
Not published

DEBIAN-CVE-2023-22485: cmark-gfm is GitHub's fork of cmark, a CommonMark parsing and rendering library and program in C. Affects cmark-gfm versions < 0.29.0.gfm.13-1. Fixed in 0.29.0.gfm.13-1. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

Background

cmark-gfm is GitHub's fork of cmark, a library and program written in C for parsing and rendering CommonMark markdown. It is widely used for converting markdown text into HTML and other formats. The package is known for its performance and compliance with the CommonMark specification, making it a popular choice among developers. However, it has been identified to have a vulnerability that can lead to potential security risks if not addressed promptly.

Vulnerability Detail

The vulnerability identified as DEBIAN-CVE-2023-22485 is an out-of-bounds read that occurs in the validate_protocol function of cmark-gfm versions prior to 0.29.0.gfm.7. This flaw allows a crafted markdown document to trigger an out-of-bounds read, accessing malloc metadata. While this bug is believed to be harmless in practice, as it does not cause visible damage, it still poses a risk that could be exploited in certain scenarios.

How To Fix

Minimum fixed version

0.29.0.gfm.13-1

This is the first release that contains the fix.

sudo apt-get install --only-upgrade cmark-gfm

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

As a temporary measure, avoid processing untrusted markdown documents until the package is updated to the patched version. This can help mitigate the risk of exploitation while waiting for the fix to be applied.

Conclusion

The cmark-gfm package has a vulnerability that could potentially be exploited through crafted markdown documents. It is crucial to update to the patched version to mitigate any risks associated with this flaw. Utilizing tools like Vulert can help monitor and manage vulnerabilities effectively.

See every vulnerability recorded for cmark-gfm →

Share this vulnerability

FAQ

cmark-gfm is a library for parsing and rendering CommonMark markdown, developed as a fork of the original cmark project by GitHub.

It refers to a flaw where the program reads memory outside the bounds of allocated memory, which can lead to undefined behavior or potential information leaks.

You can use Vulert, which monitors and alerts for open-source vulnerabilities in your software. Simply upload your manifest file, such as package-lock.json, to check for vulnerabilities.

While the vulnerability is considered harmless in practice, it is still advisable to apply the patch to eliminate any potential risks.

If immediate updates are not possible, refrain from using untrusted markdown documents as a temporary workaround until the patch is applied.

Related vulnerabilities

Recent vulnerabilities recorded for cmark-gfm.

Sponsored Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

How To Fix

Minimum fixed version

0.29.0.gfm.13-1

This is the first release that contains the fix.

sudo apt-get install --only-upgrade cmark-gfm

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback