CVE-2018-3770: Remote Code Execution in markdown-pdf

markdown-pdf Updated 02 Oct 2025

Summary

27/07/2018
Yes i
Moderate
5.5

CVE-2018-3770: Remote Code Execution in markdown-pdf. Affects markdown-pdf versions < 9.0.0. Fixed in 9.0.0. 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

markdown-pdf is an npm package that converts markdown files to PDF. It is commonly used for generating PDF documents from markdown content. However, versions prior to 9.0.0 are vulnerable to Remote Code Execution. The package fails to properly sanitize HTML code in markdown files, allowing attackers to inject malicious JavaScript code. When these markdown files are converted to PDF, the resulting PDF file will execute the injected JavaScript code. This vulnerability poses a risk of remote code execution.

Vulnerability Detail

The vulnerability in markdown-pdf arises from its failure to sanitize HTML code in markdown files. This allows an attacker to inject malicious JavaScript code into the markdown file. When the file is converted to PDF using markdown-pdf, the resulting PDF file will execute the injected JavaScript code. This can lead to remote code execution, enabling an attacker to execute arbitrary code on the victim's system. The impact of this vulnerability can be severe, as it allows an attacker to gain unauthorized access and potentially compromise the entire system.

How To Fix

Minimum fixed version

9.0.0

This is the first release that contains the fix.

npm install markdown-pdf@9.0.0

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

Workaround

There is no known workaround for this vulnerability. It is essential to upgrade to the fixed version of markdown-pdf to mitigate the risk of remote code execution.

Conclusion

The vulnerability in markdown-pdf allows for remote code execution due to the lack of HTML code sanitization. Upgrading to version 9.0.0 or later is crucial to mitigate this risk. It is recommended to promptly update the package to ensure the security of the system. For further assistance or support in vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for markdown-pdf →

Share this vulnerability

FAQ

markdown-pdf is an npm package used for converting markdown files to PDF.

The vulnerability allows an attacker to execute arbitrary code on the victim's system, potentially leading to unauthorized access and compromise of the entire system.

To fix this vulnerability, you need to upgrade to version 9.0.0 or later of markdown-pdf.

No, there is no known workaround. Upgrading to the fixed version is the recommended solution.

You can find more information about this vulnerability in the GitHub Advisory Database.

Related vulnerabilities

Recent vulnerabilities recorded for markdown-pdf.

How To Fix

Minimum fixed version

9.0.0

This is the first release that contains the fix.

npm install markdown-pdf@9.0.0

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