Skip to content
OpenAdvisories
Critical · 10.0 CVE-2025-65108 EUVD-2025-198317GHSA-547r-qmjm-8hvw

md-to-pdf is vulnerable to arbitrary JavaScript code execution when parsing front matter

Published Nov 21, 2025 · Updated Nov 24, 2025 · Assigned by GitHub_M

Description

md-to-pdf is a CLI tool for converting Markdown files to PDF using Node.js and headless Chrome. Prior to version 5.2.5, a Markdown front-matter block that contains JavaScript delimiter causes the JS engine in gray-matter library to execute arbitrary code in the Markdown to PDF converter process of md-to-pdf library, resulting in remote code execution. This issue has been patched in version 5.2.5.

Affected products

VendorProductAffectedFixed
simonhaenisch md-to-pdf < 5.2.5 —

Affected packages

EcosystemPackageAffectedFixedRecord
npm md-to-pdf < 5.2.5 5.2.5 GHSA-547r-qmjm-8hvw

References