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.
Published: 2026-04-16
Score: 4.8 Medium
EPSS: < 1% Very Low
KEV: No
Impact: Unsanitized ANSI escape sequence injection in terminal output
Action: Immediate Patch
AI Analysis

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. EPSS data is not available 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.

Generated by OpenCVE AI on April 16, 2026 at 02:12 UTC.

Remediation

No vendor fix or workaround currently provided.

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 16, 2026 at 02:12 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

Thu, 16 Apr 2026 14:15:00 +0000

Type Values Removed Values Added
Metrics ssvc

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


Thu, 16 Apr 2026 09:30:00 +0000

Type Values Removed Values Added
First Time appeared Artifex
Artifex mupdf
Vendors & Products Artifex
Artifex mupdf

Thu, 16 Apr 2026 01:45:00 +0000

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'}


cve-icon MITRE

Status: PUBLISHED

Assigner: VulnCheck

Published:

Updated: 2026-04-16T13:53:40.763Z

Reserved: 2026-04-13T20:29:02.808Z

Link: CVE-2026-40505

cve-icon Vulnrichment

Updated: 2026-04-16T13:53:21.890Z

cve-icon NVD

Status : Received

Published: 2026-04-16T02:16:11.887

Modified: 2026-04-16T02:16:11.887

Link: CVE-2026-40505

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-04-16T09:12:03Z

Weaknesses