Denial of Service Vulnerability in Node-marked Package

node-marked Updated 02 Oct 2025

Summary

14/01/2022
N/A
Yes i
Unrated
Not published

DEBIAN-CVE-2022-21681: Marked is a markdown parser and compiler. Affects node-marked versions < 4.0.12+ds+~4.0.1-1. Fixed in 4.0.12+ds+~4.0.1-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 Devnack Penetration testing for web, API and mobile Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

Node-marked is a markdown parser and compiler used in various applications to convert markdown text into HTML. It is widely utilized due to its efficiency and ease of integration. However, prior to version 4.0.10, it contained a vulnerability that could lead to denial of service (DoS) when processing untrusted markdown input.

Vulnerability Detail

The vulnerability arises from a regular expression, 'inline.reflinkSearch', which may cause catastrophic backtracking against certain strings. This can lead to excessive resource consumption, resulting in a denial of service. If untrusted markdown is processed without appropriate safeguards, it can severely impact the application's performance and availability.

How To Fix

Minimum fixed version

4.0.12+ds+~4.0.1-1

This is the first release that contains the fix.

sudo apt-get install --only-upgrade node-marked

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 through the marked package. Alternatively, run marked on a worker thread with a set time limit to prevent resource exhaustion. For example, you can implement a worker thread in Node.js as follows:

const { Worker } = require('worker_threads');

const worker = new Worker('./path_to_your_worker.js');
worker.postMessage(markdownInput);

worker.setTimeout(5000);

// Set a timeout of 5 seconds

Conclusion

The node-marked package has a critical vulnerability that can lead to denial of service when processing untrusted markdown. It is essential to update to the patched version or implement workarounds to mitigate the risk. Regular monitoring using tools like Vulert can help maintain the security of your applications.

See every vulnerability recorded for node-marked →

Share this vulnerability

FAQ

The vulnerability can lead to denial of service, causing applications to become unresponsive when processing certain markdown inputs.

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

Yes, the vulnerability is patched in version 4.0.12+ds+~4.0.1-1 of the node-marked package.

If you cannot update the package, avoid processing untrusted markdown or run the marked parser in a controlled environment with time limits.

You can find detailed information about this vulnerability in the Debian CVE database or on the Vulert website.

Related vulnerabilities

Recent vulnerabilities recorded for node-marked.

How To Fix

Minimum fixed version

4.0.12+ds+~4.0.1-1

This is the first release that contains the fix.

sudo apt-get install --only-upgrade node-marked

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