---
title: "CVE-2025-65108: md-to-pdf vulnerable to arbitrary JavaScript code execution when parsing front matter"
url: https://erroneo.us/security/cve/CVE-2025-65108/
description: "CVE-2025-65108 (md-to-pdf (npm)): 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…"
type: vulnerability-record
section: "Security Digest"
date_published: 2025-11-21
date_modified: 2025-11-25
publisher: erroneo.us
author: erroneo.us Security Desk
cve: "CVE-2025-65108"
kev: false
cvss: 10
epss: 0.00926
license: All rights reserved. Quote with attribution and a link.
---

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

**Signal:** Critical and remotely reachable. No known exploitation yet, but it is network-reachable without credentials. (Computed from CISA KEV, EPSS and CVSS; not an editorial verdict.)

## Should you act?

- Not in CISA KEV , but CISA’s SSVC assessment records a public proof-of-concept, so attack code exists.
- EPSS 0.9% , percentile 60: FIRST’s model estimates a 0.9% chance of exploitation activity in the next 30 days, higher than 60% of all scored CVEs (moderate). EPSS is a probability, not a verdict.
- Remotely reachable with no login and no user interaction. If the vulnerable service is exposed to the internet, prioritize it.
- Only applies if your dependency tree includes md-to-pdf (npm) < 5.2.5, fixed in 5.2.5 . Check your lockfile, including transitive dependencies.

## What it is

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

- npm `md-to-pdf` < 5.2.5 → fixed: 5.2.5

## Affected products (CVE record)

- simonhaenisch md-to-pdf: < 5.2.5

## Severity

- GitHub_M CVSS 3.1: 10 `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 `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H`

## Exploitation

- CISA KEV: not listed (no confirmed in-the-wild exploitation known to CISA).
- CISA SSVC assessment: exploitation poc , automatable yes , technical impact total .
- FIRST EPSS (model of 2026-10-21): 0.93% probability of exploitation activity in the next 30 days; percentile 60.

## Sources

- [GitHub Advisory GHSA-547r-qmjm-8hvw](https://github.com/advisories/GHSA-547r-qmjm-8hvw)
- [CVE.org record CVE-2025-65108](https://www.cve.org/CVERecord?id=CVE-2025-65108)
- [NVD entry CVE-2025-65108](https://nvd.nist.gov/vuln/detail/CVE-2025-65108)
- [github.com](https://github.com/simonhaenisch/md-to-pdf/security/advisories/GHSA-547r-qmjm-8hvw)
- [github.com](https://github.com/simonhaenisch/md-to-pdf/commit/46bdcf2051c8d1758b391c1353185a179a47a4d9)

---
Source page: https://erroneo.us/security/cve/CVE-2025-65108/ · Security Digest: https://erroneo.us/security/ · More: https://erroneo.us/llms.txt
