CVE-2025-65108: md-to-pdf vulnerable to arbitrary JavaScript code execution when parsing front matter
Affects md-to-pdfSource GCVE Database
Not known to be exploited · CVSS 10.0 Critical : upgrade to 5.2.5 as a priority.
Data as of 19 Nov 2026, 02:18 UTC
Thin evidence
One scorer or none| CNA (GitHub_M) | CVSS 3.1 | 10.0 |
|---|
- Patch
- Available – fixed in 5.2.5
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:HExploitation evidence
Disclosed: evidence found.
CVE published 21 Nov 2025
Detectable: no evidence on record.
No public nuclei template indexed
Weaponized: no evidence on record.
No public exploit code indexed in Metasploit or Exploit-DB
Exploited in the wildExploited: no evidence on record.
Not in CISA KEV and no source reports exploitation
Observed by OffSeq MirageSeen by Mirage: no evidence on record.
No attack traffic recorded by OffSeq Mirage sensors
A missing step is not evidence of safety. Sources: cve.org (opens in a new tab), the Metasploit, Exploit-DB and nuclei-templates index as of 18 Nov 2026.
What to do
Upgrade md-to-pdf to 5.2.5.
Affected software
| Product | Affected | Fixed in |
|---|---|---|
| npmmd-to-pdf | Affected
| Fixed in
|
Check your own hosts for these packages with threat-finder (opens in a new tab), our free open-source scanner.
AI-suggested
A patch is available in md-to-pdf version 5.2.5 that fixes this vulnerability. Users should upgrade to version 5.2.5 or later to remediate the issue. Until patched, avoid processing untrusted Markdown input containing JavaScript front-matter delimiters. No other vendor advisory mitigation instructions are provided.
Description
The md-to-pdf library versions prior to 5.2.5 are vulnerable to remote code execution due to unsafe evaluation of JavaScript in Markdown front-matter. The vulnerability arises from the gray-matter library's JavaScript engine, which executes code when front-matter delimiters like ---javascript are present. An attacker can craft malicious Markdown input that triggers arbitrary code execution in the conversion process. This can lead to full system compromise if the converter runs in an exposed environment.
References
- github.com/simonhaenisch/md-to-pdf/security/advisories/GHSA-547r-qmjm-8hvw (opens in a new tab)
- nvd.nist.gov/vuln/detail/CVE-2025-65108 (opens in a new tab)
- github.com/simonhaenisch/md-to-pdf/commit/46bdcf2051c8d1758b391c1353185a179a47a4d9 (opens in a new tab)
- github.com/simonhaenisch/md-to-pdf (opens in a new tab)