Quick answers
- Is CVE-2026-40505 exploited in the wild?
- No. Junglewise Threat Intelligence has no report of CVE-2026-40505 being exploited in the wild.
- How severe is CVE-2026-40505?
- Low severity, with a CVSS score of 3.3, published 16 April 2026.
- Which products and versions are affected?
- Artifex Software MuPDF < 1.27.0.
- Is there a fix for CVE-2026-40505?
- A patch was published on 2026-02-09: Initial patch committed to source repository Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
- How is CVE-2026-40505 attacked?
- It is attacked with local access, in a software library.
- Am I affected by CVE-2026-40505?
- Check whether you run Artifex Mupdf. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.
Technical details
An ANSI injection vulnerability exists in the 'mutool' utility of MuPDF versions prior to 1.27.0. The root cause is the improper neutralization of escape sequences (CWE-150) within PDF metadata fields, specifically font names, which are passed unsanitized to the terminal output during the execution of 'mutool info'. A local attacker can exploit this by providing a victim with a maliciously crafted PDF file. When the victim processes the file using mutool, the embedded ANSI escape codes can clear the terminal, reposition the cursor, or spoof command prompts, facilitating social engineering attacks. The issue was addressed in version 1.27.0 by using the '%q' format specifier to properly quote and sanitize font names before output.
Affected products
- Artifex Software MuPDF < 1.27.0
Timeline
- 2026-02-09: patched: Initial patch committed to source repository
- 2026-04-15: advisory: VulnCheck published advisory
- 2026-04-16: disclosed: CVE published to NVD
References
- https://cgit.ghostscript.com/cgi-bin/cgit.cgi/mupdf.git/commit/?id=0f17d789fe8c29b41e47663be82514aaca3a4dfb
- https://github.com/ArtifexSoftware/mupdf/commit/0f17d789fe8c29b41e47663be82514aaca3a4dfb
- https://github.com/ArtifexSoftware/mupdf/releases/tag/1.27.0
- https://www.vulncheck.com/advisories/mupdf-mutool-ansi-injection-via-metadata