Vulnerability · Published Nov 21, 2025 · Assigned by GitHub_M

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

Critical 10.0

In plain English

A critical-severity code injection in md-to-pdf from simonhaenisch. Proof-of-concept exploit code is public. The chance it is exploited in the next 30 days is estimated at 1.0% (higher than 62% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.

Severity (CVSS 3.1)10.0Critical
Exploit odds (30 days)1.0%top 38.3% of all CVEs
Exploited in the wildNo reportsCISA SSVC: poc
Attack toolingNoneno public tooling known

Official 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 packages & fixed versions

EcosystemPackageFixed inAdvisory
npmmd-to-pdf5.2.5GHSA-547r-qmjm-8hvw

Affected products (as reported)

VendorProductVersions
simonhaenisch md-to-pdf < 5.2.5

Weakness: CWE-94 · Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H

References