CVE-2026-40505: MuPDF < 1.27 mutool ANSI Injection via Metadata
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.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
mupdf/mutoolto a version that resolves this vulnerability.Fixed in 1.27 - Compensating control
Avoid running `mutool info` on untrusted or attacker-supplied PDFs until MuPDF is upgraded to 1.27 or later, since the vulnerability allows ANSI escape sequence injection via PDF metadata.
Event History
Frequently Asked Questions
What is the severity of CVE-2026-40505?
CVE-2026-40505 has been assigned a moderate severity level due to its potential for exploitation through malicious PDF metadata.
How do I fix CVE-2026-40505?
To fix CVE-2026-40505, ensure you update to the latest version of MuPDF mutool where this vulnerability has been addressed.
What systems are affected by CVE-2026-40505?
CVE-2026-40505 affects all versions of Artifex MuPDF mutool prior to the remediation release.
What type of attack does CVE-2026-40505 enable?
CVE-2026-40505 enables attackers to inject arbitrary ANSI escape sequences into terminal output via malicious PDF metadata.
Can CVE-2026-40505 lead to remote code execution?
While CVE-2026-40505 does not directly lead to remote code execution, it enables potential phishing or social engineering attacks through malicious terminal output.