Skip to main content
Live Webinar with SANS (June 25)— Agentic CTI Automation for Fun & ProfitRegister Free
Mallory
CriticalPublic exploit

RCE in md-to-pdf via JavaScript Injection in Markdown Front-Matter

IdentifiersCVE-2025-65108CWE-94· Improper Control of Generation of…

CVE-2025-65108 is a remote code execution vulnerability in md-to-pdf, a CLI tool that converts Markdown files to PDF using Node.js and headless Chrome. In versions prior to 5.2.5, a crafted Markdown front-matter block containing JavaScript delimiters can trigger arbitrary code execution during parsing. The issue is attributed to the gray-matter library behavior in the md-to-pdf conversion process, where attacker-controlled content in front-matter is interpreted by the JavaScript engine instead of being treated strictly as data. As a result, processing a malicious Markdown file can execute arbitrary code in the context of the md-to-pdf process.

Share:
For your environment

Are you exposed to this one?

Mallory correlates every CVE against your assets, your vendors, and active adversary campaigns. Know which vulnerabilities matter for you, not just which ones are loud.

ANALYST BRIEF

Impact, mitigation & remediation

What it means. What to do now. Patch path, mitigations, and the assume-compromise checklist.

Impact

What an attacker gets, and what they’ve been doing with it.

Successful exploitation allows arbitrary code execution on the system running md-to-pdf. Because the payload executes within the Markdown-to-PDF converter process, an attacker can run commands with the privileges of the invoking user or service account. Depending on deployment context, this can lead to full host compromise, unauthorized access to local files and secrets available to the process, CI/CD runner compromise, and follow-on lateral movement.

Mitigation

If you can’t patch tonight, do this now.

Until patching is complete, do not process untrusted Markdown input with vulnerable md-to-pdf versions. Isolate document conversion in a hardened sandbox or container with minimal privileges, restricted filesystem access, and no access to sensitive credentials or internal networks. Where possible, disable or strictly validate front-matter handling before conversion, and treat uploaded or externally supplied Markdown files as untrusted content.

Remediation

Patch, then assume compromise.

Upgrade md-to-pdf to version 5.2.5 or later, which patches this issue. If md-to-pdf is embedded in automation pipelines, server-side document conversion services, or other workflows, ensure all affected environments are updated and rebuild dependencies to pick up the fixed version. Validate that no older vulnerable versions remain pinned in lockfiles or bundled artifacts.
PUBLIC EXPLOITS

Exploits

No public exploits tracked yet. Mallory keeps watching.

VALID 0 / 0 TOTALView more in app

No public exploit code observed for this vulnerability.

What this page doesn’t show

The version that knows your environment.

This page is what’s public. Mallory adds the parts that aren’t: which of your assets are affected, which adversaries are exploiting it right now, which detections to deploy, and what to do tonight.
Exposure mapping

Query your assets running an affected version, and investigate the blast radius.

Threat actor evidence

Every observed campaign linking this CVE to a named adversary.

Associated malware

Malware families riding this exploit, with evidence and IOCs.

Detection signatures

YARA, Sigma, Snort, and vendor rules, auto-deployed to your SIEM.

Vendor-by-vendor mapping

Cross-references every affected SKU, including bundled OEM variants.

Social activity4

Community discussion across Reddit, Mastodon, and other social sources.