CVE-2026-40505

MuPDF < 1.27 mutool ANSI Injection via Metadata

Published Apr 16, 2026 CVSS 4.0 · 4.8 Medium EPSS < 1% KEV · Not listed
Description
MuPDF before 1.27 contains an ANSI injection vulnerability in mutool that allows attackers to inject arbitrary ANSI escape sequences through crafted PDF metadata fields. Attackers can embed malicious ANSI escape codes in PDF metadata that are passed unsanitized to terminal output when running mutool info, enabling them to manipulate terminal display for social engineering attacks such as presenting fake prompts or spoofed commands.

Analysis

AI-generated

Technical impact

MuPDF mutool does not sanitize PDF metadata before delivering it to the terminal, allowing attackers to embed arbitrary ANSI escape sequences into PDF metadata. When a user runs mutool info, those sequences are interpreted by the terminal, which can clear the display and render arbitrary text, enabling social‑engineering attacks such as presenting fake prompts or spoofed commands.

Affected Systems

Every installation of Artifex Software Inc.’s MuPDF that includes the mutool utility and has not applied the sanitization patch is vulnerable. The issue applies to all versions of MuPDF lacking the recent commit that filters metadata before output.

Risk and Exploitability

The CVSS score of 4.8 indicates moderate severity. The EPSS score is < 1% and the vulnerability is not listed in CISA’s KEV catalog. Exploitation requires a crafted PDF and the legitimate user to execute mutool info, making the attack local and user‑dependent. Despite the local nature, the potential for social engineering warrants prompt action to mitigate the risk.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade MuPDF to the latest version that includes the metadata sanitization fix.
  • Avoid running mutool info on PDFs that are not trusted or have been obtained from untrusted sources.
  • Configure the terminal or use an emulator that ignores or disables ANSI escape codes to prevent unintended screen manipulation.

Generated by OpenCVE AI on April 18, 2026 at 09:26 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
CPEs cpe:2.3:a:artifex:mupdf:*:*:*:*:*:*:*:*
Type Values Removed Values Added
Description MuPDF mutool does not sanitize PDF metadata fields before writing them to terminal output, allowing attackers to inject arbitrary ANSI escape sequences through crafted PDF metadata. Attackers can embed malicious ANSI escape codes in PDF metadata that are passed unsanitized to the terminal when running mutool info, enabling them to clear the terminal display and render arbitrary text for social engineering attacks such as presenting fake prompts or spoofed commands. MuPDF before 1.27 contains an ANSI injection vulnerability in mutool that allows attackers to inject arbitrary ANSI escape sequences through crafted PDF metadata fields. Attackers can embed malicious ANSI escape codes in PDF metadata that are passed unsanitized to terminal output when running mutool info, enabling them to manipulate terminal display for social engineering attacks such as presenting fake prompts or spoofed commands.
Title MuPDF mutool ANSI Injection via Metadata MuPDF < 1.27 mutool ANSI Injection via Metadata
References
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
First Time appeared Artifex
Artifex mupdf
Vendors & Products Artifex
Artifex mupdf
Type Values Removed Values Added
Description MuPDF mutool does not sanitize PDF metadata fields before writing them to terminal output, allowing attackers to inject arbitrary ANSI escape sequences through crafted PDF metadata. Attackers can embed malicious ANSI escape codes in PDF metadata that are passed unsanitized to the terminal when running mutool info, enabling them to clear the terminal display and render arbitrary text for social engineering attacks such as presenting fake prompts or spoofed commands.
Title MuPDF mutool ANSI Injection via Metadata
Weaknesses CWE-150
References
Metrics cvssV3_1

{'score': 3.3, 'vector': 'CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:N'}

cvssV4_0

{'score': 4.8, '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'}

Weaknesses
  • CWE-150

    Improper Neutralization of Escape, Meta, or Control Sequences

Sources

Status
PUBLISHED
Assigner
VulnCheck
Published
Updated
Nov 8, 2026, 2:02 PM
Reserved
Apr 13, 2026, 8:29 PM
Status
Analyzed
Published
Apr 16, 2026, 2:16 AM
Modified
Oct 26, 2026, 9:10 PM