Cross-Site Scripting Vulnerabilities in Node.js Marked Package

node-marked Updated 02 Oct 2025

Summary

06/01/2020
N/A
Yes i
Medium
6.1

CVE-2014-3743: Multiple cross-site scripting (XSS) vulnerabilities in the Marked module before 0.3.1 for Node.js allow remote attackers to inject arbitrary web script or HTML via vectors related to (1) gfm codeblocks (language) or (2)... Affects node-marked versions < 0.3.1+dfsg-1. Fixed in 0.3.1+dfsg-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

The Marked package is a widely used Markdown parser and compiler for Node.js, enabling developers to convert Markdown text into HTML. It is valued for its speed and efficiency in rendering Markdown content. However, prior to version 0.3.1, the package was susceptible to multiple cross-site scripting (XSS) vulnerabilities, which could allow attackers to inject malicious scripts into web applications that utilize this package.

Vulnerability Detail

The vulnerabilities stem from improper handling of user input, specifically in gfm codeblocks and JavaScript URLs. Attackers could exploit these weaknesses to inject arbitrary web scripts or HTML, potentially leading to unauthorized actions, data theft, or session hijacking. The vulnerabilities were identified in versions of the Marked package before 0.3.1, posing a significant risk to applications relying on this package for Markdown processing.

How To Fix

Minimum fixed version

0.3.1+dfsg-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

If immediate upgrading is not feasible, consider sanitizing user input before processing it with the Marked package. Implementing a library like DOMPurify can help clean the input and prevent XSS attacks. Example code for sanitization:

const DOMPurify = require('dompurify');
const { JSDOM } = require('jsdom');
const window = new JSDOM('').window;
const purify = DOMPurify(window);

const cleanInput = purify.sanitize(userInput);
const htmlOutput = marked(cleanInput);

Conclusion

The vulnerabilities in the Marked package highlight the importance of maintaining up-to-date dependencies in software projects. By upgrading to version 0.3.1 or later, developers can protect their applications from potential XSS attacks. Additionally, utilizing input sanitization techniques can provide an extra layer of security.

See every vulnerability recorded for node-marked →

Share this vulnerability

FAQ

The CVSS score of this vulnerability is 6.1, indicating a moderate level of severity.

You can use Vulert's playground at Vulert Scanner to check if your application is affected by this vulnerability without requiring any signup.

Exploitation of this vulnerability could lead to unauthorized script execution, data theft, and compromised user sessions.

Yes, you can sanitize user inputs using libraries like DOMPurify to prevent XSS attacks until you can upgrade the package.

All versions of the Marked package prior to 0.3.1 are affected by these vulnerabilities.

Related vulnerabilities

Recent vulnerabilities recorded for node-marked.

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.3.1+dfsg-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