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

- Severity: Critical 10.0 (CVSS:3.1, scored by GitHub_M) `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.96%, higher than 62% of CVEs (2026-12-01)
- Published: 2025-11-20T17:48:11.000Z
- Modified: 2026-10-18T20:10:00.110Z
- Also known as: GHSA-547r-qmjm-8hvw
- Weaknesses: CWE-94
- SSVC (CISA-ADP): exploitation poc, automatable yes, technical impact total
- 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.

(As written by CVE List.)

## Affected

- simonhaenisch md-to-pdf: < 5.2.5
- md-to-pdf (npm): before 5.2.5

## Every score

- GitHub_M: CVSS:3.1 10.0 Critical `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H`
- GitHub: CVSS:3.1 10.0 Critical `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H`

## References

- <https://github.com/simonhaenisch/md-to-pdf/security/advisories/GHSA-547r-qmjm-8hvw> (web)
- <https://github.com/simonhaenisch/md-to-pdf/commit/46bdcf2051c8d1758b391c1353185a179a47a4d9> (web)
- <https://nvd.nist.gov/vuln/detail/CVE-2025-65108> (advisory)
- <https://github.com/simonhaenisch/md-to-pdf> (package)

## Sources

- CVE List: [CVE-2025-65108](https://www.cve.org/CVERecord?id=CVE-2025-65108), CVE Terms of Use, modified 2025-11-24
- GitHub Advisory Database: [GHSA-547r-qmjm-8hvw](https://github.com/advisories/GHSA-547r-qmjm-8hvw), CC-BY-4.0, modified 2025-11-25
- NVD: [CVE-2025-65108](https://nvd.nist.gov/vuln/detail/CVE-2025-65108), Public domain, modified 2026-10-18

---

Page: https://cve.day/CVE-2025-65108 · Whole record: https://cve.day/CVE-2025-65108.json · Rebuilt by cve.day 2026-11-25T22:59:07.931Z
