Skip to content

← Public intelligence

npm package

md-to-pdf

Open actionable advisories and recorded vendor fixes. This public package view has no inventory attached and cannot establish whether your deployment is affected. A vendor fix never resolves your finding; verify your installed version and the source guidance.

Open advisories

2 actionable advisories, newest first. Withdrawn advisories and news are excluded. Coverage is partial.

  1. Critical, CVSS 10.0npmAmendedPublished

    md-to-pdf vulnerable to arbitrary JavaScript code execution when parsing front matter

    CVE-2025-65108 · GHSA-547r-qmjm-8hvw

    Affected
    • npm md-to-pdf < 5.2.5
    Fixed in
    5.2.5· Vendor fix available
    Issue
    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. Details md-to-pdf uses the gray-matter library to parse front-matter. Gray-matter exposes a JavaScript engine that, when enabled or triggered by certain front-matter delimiters (e.g. ---js or ---javascript), will evaluate the front-matter contents as JavaScript. If user-supplied Markdown is fed to md-to-pdf and the front-matter contains malicious JS, the converter process will execute that code. PoC Running the PoC on Windows launches the calculator application, demonstrating arbitrary code execution. Impact - Remote code execution in the process that performs Markdown-PDF conversion. - If the converter is run in a web app or cloud service, an attacker uploading malicious Markdown can execute arbitrary commands on the

    Recommended action: Upgrade to 5.2.5 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:github.com (1)osv.dev (2)Source checked Evidence →
  2. Critical, CVSS 9.8npmAmendedPublished

    Code Injection in md-to-pdf.

    CVE-2021-23639 · GHSA-x949-7cm6-fm6p

    Affected
    • npm md-to-pdf < 5.0.0
    Fixed in
    5.0.0· Vendor fix available
    Issue
    The package md-to-pdf before 5.0.0 are vulnerable to Remote Code Execution (RCE) due to utilizing the library gray-matter to parse front matter content, without disabling the JS engine.

    Recommended action: Upgrade to 5.0.0 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:osv.dev (1)github.com (2)Source checked Evidence →