The SentinelOne Annual Threat Report - A Defenders Guide from the FrontlinesThe SentinelOne Annual Threat ReportGet the Report
Experiencing a Breach?Blog
Get StartedContact Us
SentinelOne
  • Platform
    Platform Overview
    • Singularity Platform
      Welcome to Integrated Enterprise Security
    • AI for Security
      Leading the Way in AI-Powered Security Solutions
    • Securing AI
      Accelerate AI Adoption with Secure AI Tools, Apps, and Agents.
    • How It Works
      The Singularity XDR Difference
    • Singularity Marketplace
      One-Click Integrations to Unlock the Power of XDR
    • Pricing & Packaging
      Comparisons and Guidance at a Glance
    Data & AI
    • Purple AI
      Accelerate SecOps with Generative AI
    • Singularity Hyperautomation
      Easily Automate Security Processes
    • AI-SIEM
      The AI SIEM for the Autonomous SOC
    • AI Data Pipelines
      Security Data Pipeline for AI SIEM and Data Optimization
    • Singularity Data Lake
      AI-Powered, Unified Data Lake
    • Singularity Data Lake for Log Analytics
      Seamlessly Ingest Data from On-Prem, Cloud or Hybrid Environments
    Endpoint Security
    • Singularity Endpoint
      Autonomous Prevention, Detection, and Response
    • Singularity XDR
      Native & Open Protection, Detection, and Response
    • Singularity RemoteOps Forensics
      Orchestrate Forensics at Scale
    • Singularity Threat Intelligence
      Comprehensive Adversary Intelligence
    • Singularity Vulnerability Management
      Application & OS Vulnerability Management
    • Singularity Identity
      Identity Threat Detection and Response
    Cloud Security
    • Singularity Cloud Security
      Block Attacks with an AI-Powered CNAPP
    • Singularity Cloud Native Security
      Secure Cloud and Development Resources
    • Singularity Cloud Workload Security
      Real-Time Cloud Workload Protection Platform
    • Singularity Cloud Data Security
      AI-Powered Threat Detection for Cloud Storage
    • Singularity Cloud Security Posture Management
      Detect and Remediate Cloud Misconfigurations
    Securing AI
    • Prompt Security
      Secure AI Tools Across Your Enterprise
  • Why SentinelOne?
    Why SentinelOne?
    • Why SentinelOne?
      Cybersecurity Built for What’s Next
    • Our Customers
      Trusted by the World’s Leading Enterprises
    • Industry Recognition
      Tested and Proven by the Experts
    • About Us
      The Industry Leader in Autonomous Cybersecurity
    Compare SentinelOne
    • Arctic Wolf
    • Broadcom
    • CrowdStrike
    • Cybereason
    • Microsoft
    • Palo Alto Networks
    • Sophos
    • Splunk
    • Trellix
    • Trend Micro
    • Wiz
    Verticals
    • Energy
    • Federal Government
    • Finance
    • Healthcare
    • Higher Education
    • K-12 Education
    • Manufacturing
    • Retail
    • State and Local Government
  • Services
    Managed Services
    • Managed Services Overview
      Wayfinder Threat Detection & Response
    • Threat Hunting
      World-Class Expertise and Threat Intelligence
    • Managed Detection & Response
      24/7/365 Expert MDR Across Your Entire Environment
    • Incident Readiness & Response
      DFIR, Breach Readiness, & Compromise Assessments
    Support, Deployment, & Health
    • Technical Account Management
      Customer Success with Personalized Service
    • SentinelOne GO
      Guided Onboarding & Deployment Advisory
    • SentinelOne University
      Live and On-Demand Training
    • Services Overview
      Comprehensive Solutions for Seamless Security Operations
    • SentinelOne Community
      Community Login
  • Partners
    Our Network
    • MSSP Partners
      Succeed Faster with SentinelOne
    • Singularity Marketplace
      Extend the Power of S1 Technology
    • Cyber Risk Partners
      Enlist Pro Response and Advisory Teams
    • Technology Alliances
      Integrated, Enterprise-Scale Solutions
    • SentinelOne for AWS
      Hosted in AWS Regions Around the World
    • Channel Partners
      Deliver the Right Solutions, Together
    • SentinelOne for Google Cloud
      Unified, Autonomous Security Giving Defenders the Advantage at Global Scale
    • Partner Locator
      Your Go-to Source for Our Top Partners in Your Region
    Partner Portal→
  • Resources
    Resource Center
    • Case Studies
    • Data Sheets
    • eBooks
    • Reports
    • Videos
    • Webinars
    • Whitepapers
    • Events
    View All Resources→
    Blog
    • Feature Spotlight
    • For CISO/CIO
    • From the Front Lines
    • Identity
    • Cloud
    • macOS
    • SentinelOne Blog
    Blog→
    Tech Resources
    • SentinelLABS
    • Ransomware Anthology
    • Cybersecurity 101
  • About
    About SentinelOne
    • About SentinelOne
      The Industry Leader in Cybersecurity
    • Investor Relations
      Financial Information & Events
    • SentinelLABS
      Threat Research for the Modern Threat Hunter
    • Careers
      The Latest Job Opportunities
    • Press & News
      Company Announcements
    • Cybersecurity Blog
      The Latest Cybersecurity Threats, News, & More
    • FAQ
      Get Answers to Our Most Frequently Asked Questions
    • DataSet
      The Live Data Platform
    • S Foundation
      Securing a Safer Future for All
    • S Ventures
      Investing in the Next Generation of Security, Data and AI
  • Pricing
Get StartedContact Us
CVE Vulnerability Database
Vulnerability Database/CVE-2025-65108

CVE-2025-65108: md-to-pdf RCE Vulnerability

CVE-2025-65108 is a remote code execution flaw in md-to-pdf that allows arbitrary JavaScript execution through malicious Markdown front-matter. This article covers technical details, affected versions, and mitigation.

Published: March 18, 2026

CVE-2025-65108 Overview

CVE-2025-65108 is a critical remote code execution vulnerability affecting the md-to-pdf library, 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 containing JavaScript delimiters causes the JS engine in the gray-matter library to execute arbitrary code during the Markdown to PDF conversion process, resulting in remote code execution.

Critical Impact

Attackers can achieve complete system compromise by crafting malicious Markdown files that execute arbitrary code when processed by md-to-pdf, potentially leading to data exfiltration, lateral movement, and full server takeover.

Affected Products

  • md-to-pdf versions prior to 5.2.5
  • Applications using vulnerable md-to-pdf library for Markdown processing
  • Web services accepting user-supplied Markdown content for PDF conversion

Discovery Timeline

  • 2025-11-21 - CVE-2025-65108 published to NVD
  • 2025-11-25 - Last updated in NVD database

Technical Details for CVE-2025-65108

Vulnerability Analysis

This vulnerability is classified as CWE-94 (Improper Control of Generation of Code - Code Injection). The flaw exists in how md-to-pdf handles Markdown front-matter parsing through the gray-matter library. When processing Markdown files, the library's JavaScript engine can be triggered through specially crafted front-matter delimiters, allowing arbitrary JavaScript code execution within the Node.js process context.

The vulnerability is particularly dangerous because md-to-pdf is commonly used in automated document processing pipelines, CI/CD systems, and web applications that convert user-uploaded Markdown to PDF. An attacker only needs to submit a malicious Markdown file to trigger code execution without any authentication or special privileges.

Root Cause

The root cause lies in the incorrect configuration of the gray-matter library's JavaScript engine within md-to-pdf. The library was intended to disable the JavaScript engine for security purposes but used the wrong key name (js instead of javascript) when overriding the engine configuration. This configuration error meant the security mitigation was never actually applied, leaving the JavaScript engine fully functional and able to execute code embedded in front-matter blocks.

Attack Vector

The attack is network-accessible and requires no user interaction or authentication. An attacker can exploit this vulnerability by:

  1. Crafting a Markdown file with malicious JavaScript code embedded in the front-matter section using JavaScript delimiters
  2. Submitting the malicious Markdown file to any service or application using vulnerable md-to-pdf versions
  3. When the file is processed for PDF conversion, the gray-matter library parses the front-matter and executes the embedded JavaScript code
  4. The attacker's code runs with the same privileges as the md-to-pdf process, enabling full system compromise
typescript
// Security patch in src/lib/config.ts
// Source: https://github.com/simonhaenisch/md-to-pdf/commit/46bdcf2051c8d1758b391c1353185a179a47a4d9
 	launch_options: {},
 	gray_matter_options: {
 		engines: {
-			js: () =>
+			javascript: () =>
 				new Error(
 					'The JS engine for front-matter is disabled by default for security reasons. You can enable it by configuring gray_matter_options.',
 				),

The patch corrects the engine key from js to javascript, ensuring the security override is properly applied to disable JavaScript execution in front-matter blocks by default.

Detection Methods for CVE-2025-65108

Indicators of Compromise

  • Markdown files containing unusual front-matter delimiters such as ---js or ---javascript
  • Unexpected child processes spawned by md-to-pdf or Node.js PDF conversion services
  • Suspicious network connections originating from PDF conversion processes
  • Anomalous file system access patterns from Markdown processing applications

Detection Strategies

  • Monitor for Markdown files with JavaScript delimiters in front-matter sections (---js, ---javascript)
  • Implement application-level logging for md-to-pdf conversion operations and their inputs
  • Deploy runtime application self-protection (RASP) to detect code injection attempts
  • Use SentinelOne's behavioral AI to identify anomalous process execution from document conversion services

Monitoring Recommendations

  • Enable verbose logging for all Markdown processing pipelines
  • Monitor process creation events from Node.js applications handling PDF conversion
  • Alert on any external network connections from PDF conversion service processes
  • Track file I/O operations during Markdown-to-PDF conversion for suspicious patterns

How to Mitigate CVE-2025-65108

Immediate Actions Required

  • Upgrade md-to-pdf to version 5.2.5 or later immediately
  • Audit all applications and services using md-to-pdf for vulnerable versions
  • Implement input validation to reject Markdown files with JavaScript front-matter delimiters
  • Consider isolating PDF conversion services in sandboxed environments or containers

Patch Information

The vulnerability has been patched in md-to-pdf version 5.2.5. The fix correctly configures the gray-matter library to disable the JavaScript engine by using the proper key name javascript instead of js in the engine override configuration. For detailed patch information, see the GitHub Security Advisory GHSA-547r-qmjm-8hvw and the associated commit.

Workarounds

  • If immediate upgrade is not possible, implement strict input validation to reject Markdown files containing JavaScript front-matter delimiters
  • Run md-to-pdf processes in isolated containers with restricted network access and limited file system permissions
  • Use allowlisting to restrict which users or services can submit Markdown files for conversion
  • Consider temporarily disabling automated Markdown-to-PDF conversion until patching is complete
bash
# Configuration example
# Upgrade md-to-pdf to patched version
npm update md-to-pdf@5.2.5

# Verify installed version
npm list md-to-pdf

# For yarn users
yarn upgrade md-to-pdf@5.2.5

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

  • Vulnerability Details
  • TypeRCE

  • Vendor/TechMd To Pdf

  • SeverityCRITICAL

  • CVSS Score10.0

  • EPSS Probability0.43%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityNone
  • AvailabilityHigh
  • CWE References
  • CWE-94
  • Technical References
  • GitHub Commit Overview

  • GitHub Security Advisory GHSA-547r-qmjm-8hvw
  • Latest CVEs
  • CVE-2025-9185: Mozilla Firefox RCE Vulnerability

  • CVE-2025-9184: Mozilla Firefox RCE Vulnerability

  • CVE-2025-9180: Mozilla Firefox Auth Bypass Vulnerability

  • CVE-2025-8030: Mozilla Firefox RCE Vulnerability
Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the World’s Most Advanced Cybersecurity Platform

See how our intelligent, autonomous cybersecurity platform can protect your organization now and into the future.

Try SentinelOne
  • Get Started
  • Get a Demo
  • Product Tour
  • Why SentinelOne
  • Pricing & Packaging
  • FAQ
  • Contact
  • Contact Us
  • Customer Support
  • SentinelOne Status
  • Language
  • Platform
  • Singularity Platform
  • Singularity Endpoint
  • Singularity Cloud
  • Singularity AI-SIEM
  • Singularity Identity
  • Singularity Marketplace
  • Purple AI
  • Services
  • Wayfinder TDR
  • SentinelOne GO
  • Technical Account Management
  • Support Services
  • Verticals
  • Energy
  • Federal Government
  • Finance
  • Healthcare
  • Higher Education
  • K-12 Education
  • Manufacturing
  • Retail
  • State and Local Government
  • Cybersecurity for SMB
  • Resources
  • Blog
  • Labs
  • Case Studies
  • Videos
  • Product Tours
  • Events
  • Cybersecurity 101
  • eBooks
  • Webinars
  • Whitepapers
  • Press
  • News
  • Ransomware Anthology
  • Company
  • About Us
  • Our Customers
  • Careers
  • Partners
  • Legal & Compliance
  • Security & Compliance
  • Investor Relations
  • S Foundation
  • S Ventures

©2026 SentinelOne, All Rights Reserved.

Privacy Notice Terms of Use

English