Join the Cyber Forum: Threat Intel on May 12, 2026 to learn how AI is reshaping threat defense.Join the Virtual Cyber Forum: Threat IntelRegister Now
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-2026-40505

CVE-2026-40505: MuPDF mutool XSS Vulnerability

CVE-2026-40505 is an XSS flaw in MuPDF mutool that allows ANSI escape sequence injection via PDF metadata, enabling attackers to manipulate terminal displays. This article covers technical details, impact, and mitigations.

Published: April 17, 2026

CVE-2026-40505 Overview

CVE-2026-40505 is an input validation vulnerability in MuPDF's mutool utility that fails to sanitize PDF metadata fields before writing them to terminal output. This flaw allows attackers to inject arbitrary ANSI escape sequences through crafted PDF metadata, enabling terminal manipulation attacks that can be leveraged for social engineering purposes.

When users execute mutool info on a maliciously crafted PDF file, the embedded ANSI escape codes in the document's metadata are passed directly to the terminal without sanitization. This enables attackers to clear the terminal display and render arbitrary text, potentially presenting fake prompts or spoofed commands to deceive users.

Critical Impact

Attackers can manipulate terminal output through crafted PDF files to display fake prompts, spoofed commands, or misleading information for social engineering attacks.

Affected Products

  • MuPDF mutool (versions prior to the security patch)

Discovery Timeline

  • April 16, 2026 - CVE-2026-40505 published to NVD
  • April 16, 2026 - Last updated in NVD database

Technical Details for CVE-2026-40505

Vulnerability Analysis

This vulnerability is classified under CWE-150 (Improper Neutralization of Escape, Meta, or Control Sequences). The core issue stems from MuPDF's mutool info command directly outputting PDF metadata fields to the terminal without first filtering or escaping potentially dangerous control characters.

PDF documents contain various metadata fields such as Title, Author, Subject, Keywords, Creator, Producer, and creation/modification dates. These fields are typically strings that users expect to contain human-readable text. However, the PDF specification does not restrict what characters can be included in these fields, allowing malicious actors to embed ANSI escape sequences.

ANSI escape sequences are special character combinations that terminals interpret as commands rather than displayable text. When mutool info outputs metadata containing these sequences, the terminal executes them, giving attackers control over what the user sees on their screen.

Root Cause

The root cause is the absence of output sanitization in the mutool info command's metadata display functionality. When processing PDF metadata, the code retrieves string values from the document and passes them directly to printf() or similar output functions without checking for or escaping control characters. This violates the principle of treating all external input as potentially malicious, particularly when that input will be rendered in a context (the terminal) where certain character sequences have special meaning.

Attack Vector

The attack requires local access and user interaction. An attacker must craft a malicious PDF file with ANSI escape codes embedded in one or more metadata fields and then convince a target user to run mutool info against the file. The attack scenario typically involves:

  1. The attacker creates a PDF document with malicious ANSI escape sequences in metadata fields such as Title or Author
  2. The PDF is delivered to the target through email, file sharing, or other means
  3. The victim runs mutool info malicious.pdf to inspect the document's properties
  4. The terminal interprets the escape sequences, potentially clearing the screen and displaying attacker-controlled text
  5. The fake output could instruct the user to run dangerous commands or reveal sensitive information

This type of terminal manipulation attack can display fake sudo prompts, fabricated error messages demanding administrative actions, or spoofed command outputs that mislead users about the state of their system.

Detection Methods for CVE-2026-40505

Indicators of Compromise

  • PDF files with unusual escape sequences (starting with \\x1b[ or \033[) in metadata fields
  • User reports of unexpected terminal behavior after running mutool info
  • PDF documents with metadata containing non-printable ASCII characters or control sequences
  • Unusual strings in PDF Title, Author, Subject, or other metadata fields that contain bracket sequences

Detection Strategies

  • Implement file scanning rules to detect ANSI escape sequences in PDF metadata fields
  • Monitor for PDF files with metadata containing the hexadecimal byte 0x1B (ESC character)
  • Deploy endpoint detection rules that flag PDFs with unusual control characters in document properties
  • Use YARA rules to identify PDF files containing escape sequence patterns in metadata streams

Monitoring Recommendations

  • Log and alert on mutool info executions against PDF files from untrusted sources
  • Implement terminal logging to capture unexpected escape sequence injection attempts
  • Monitor for user-reported incidents of terminal display anomalies following PDF inspection
  • Review PDF files in secure environments before allowing mutool operations

How to Mitigate CVE-2026-40505

Immediate Actions Required

  • Update MuPDF to a patched version that includes the security fix
  • Avoid running mutool info on PDF files from untrusted sources until patched
  • Consider using alternative PDF metadata inspection tools that properly sanitize output
  • Review and inspect PDF files in sandboxed environments before processing

Patch Information

The MuPDF development team has addressed this vulnerability in a Git commit that implements proper sanitization of metadata fields before terminal output. Users should update to the latest version of MuPDF that includes this fix. Additional details are available in the VulnCheck Advisory.

Workarounds

  • Pipe mutool info output through cat -v to visualize non-printable characters: mutool info file.pdf | cat -v
  • Use terminal emulators with escape sequence filtering capabilities
  • Inspect PDF metadata using GUI-based tools that don't interpret ANSI sequences
  • Set terminal environment variables to disable escape sequence interpretation where possible
  • Process PDF files only in isolated environments or containers when handling untrusted documents

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

  • Vulnerability Details
  • TypeXSS

  • Vendor/TechMupdf

  • SeverityMEDIUM

  • CVSS Score4.8

  • EPSS Probability0.01%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:P/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityLow
  • AvailabilityNone
  • CWE References
  • CWE-150
  • Technical References
  • MuPDF Git Commit Notice

  • VulnCheck Advisory on MuPDF
  • Related CVEs
  • CVE-2026-3308: Artifex MuPDF RCE Vulnerability

  • CVE-2025-15569: Artifex MuPDF Path Traversal Vulnerability

  • CVE-2026-25556: MuPDF Use After Free 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