md-to-pdf is vulnerable to arbitrary JavaScript code execution when parsing front matter
Key facts
- Attack vector
- Network
- Privileges required
- None
- User interaction
- None
- Attack complexity
- Low
- Impact type
- Code execution
- Confidentiality · integrity · availability
- High · High · High
- Fix status
- Fixed
Attack profile from CVSS 3.1 · CNA. Fix status from CNA and GitHub. Impact type from CWE-94.
Summary
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.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- Poc
- Automatable
- Yes
- Technical impact
- Total
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| simonhaenisch | md-to-pdf | before 5.2.5 | 5.2.5 | Patch available | CNA |
| — | md-to-pdf (npm) | before 5.2.5 | 5.2.5 | Patch available | GHSA-547r-qmjm-8hvw |
- md-to-pdf Vendorsimonhaenisch Affected before 5.2.5 Fixed in 5.2.5 Patch available CNA
- md-to-pdf (npm) Vendor— Affected before 5.2.5 Fixed in 5.2.5 Patch available GHSA-547r-qmjm-8hvw
Remediation
- Fix · CNA md-to-pdf (simonhaenisch) Fixed in 5.2.5
- Fix · GHSA-547r-qmjm-8hvw md-to-pdf (npm) Fixed in 5.2.5 Advisory →
Timeline
- 2026-10-02 Threatist record created from CVE-2025-65108
- 2026-10-03 Alias added: GHSA-547r-qmjm-8hvw
References
Sources
- CVE-2025-65108 · CVE Program
- CVE-2025-65108 · NVD
- FIRST EPSS
- GHSA-547r-qmjm-8hvw · GitHub Advisory Database · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences