{"id":"CVE-2025-65108","published":"2025-11-21T21:52:02Z","modified":"2025-11-24T17:17:08Z","title":"md-to-pdf is vulnerable to arbitrary JavaScript code execution when parsing front matter","vendor":"simonhaenisch","product":"md-to-pdf","tier":"tail","description":{"text":"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.","provenance":"source","from":"CVE.org"},"cvss":{"score":10,"severity":"CRITICAL","version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.0096,"percentile":0.62405,"provenance":"source"},"cwes":[{"id":"CWE-94","name":"Improper Control of Generation of Code"}],"references":[{"url":"https://github.com/simonhaenisch/md-to-pdf/security/advisories/GHSA-547r-qmjm-8hvw","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/simonhaenisch/md-to-pdf/commit/46bdcf2051c8d1758b391c1353185a179a47a4d9","tags":["x_refsource_MISC"]}],"priority":{"score":19.5,"factors":[{"name":"EPSS percentile","points":12.48},{"name":"CVSS severity","points":7.0}]},"vendorSlug":"simonhaenisch","affectedVersions":[{"vendor":"simonhaenisch","product":"md-to-pdf","versions":["< 5.2.5"]}],"ssvc":{"exploitation":"poc","automatable":"yes","technicalImpact":"total","timestamp":"2025-11-24T17:17:00.852694Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"npm","package":"md-to-pdf","vulnerableRanges":["<5.2.5"],"patched":["5.2.5"],"from":["GHSA-547r-qmjm-8hvw"],"provenance":"source"}],"summary":{"text":"The md-to-pdf CLI tool for converting Markdown to PDF, produced by simonhaenisch, contains a code injection flaw in how it parses front matter via the gray-matter library: a front-matter block using the JavaScript delimiter is executed by the JS engine within the converter process. An attacker who can supply a crafted Markdown file to the converter can run arbitrary code in that process over the network, with no authentication or user interaction required, and the flaw is fixed in version 5.2.5.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T07:15:08Z"},"euvd":{"id":"EUVD-2025-198317","exploited":false,"provenance":"source"},"lineage":{"familyId":"fam-simonhaenisch-md-to-pdf-cve-2021-23639","parents":[{"from":"CVE-2021-23639","to":"CVE-2025-65108","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["src/lib/config.ts"],"commits":["https://github.com/simonhaenisch/md-to-pdf/commit/a716259c548c82fa1d3b14a3422e9100619d2d8a","https://github.com/simonhaenisch/md-to-pdf/commit/46bdcf2051c8d1758b391c1353185a179a47a4d9"],"basis":"rarely changed file"},{"kind":"similar","provenance":"machine","score":0.53,"basis":"same package + description similarity"}]}]}}