{"id":"UBUNTU-CVE-2026-40505","details":"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.","modified":"2026-05-20T16:25:40.098118481Z","published":"2026-04-16T02:16:00Z","upstream":["CVE-2026-40505"],"references":[{"type":"REPORT","url":"https://ubuntu.com/security/CVE-2026-40505"},{"type":"REPORT","url":"https://www.cve.org/CVERecord?id=CVE-2026-40505"},{"type":"REPORT","url":"https://cgit.ghostscript.com/cgi-bin/cgit.cgi/mupdf.git/commit/?id=0f17d789fe8c29b41e47663be82514aaca3a4dfb"},{"type":"REPORT","url":"https://bugs.ghostscript.com/show_bug.cgi?id=709108"}],"affected":[{"package":{"name":"mupdf","ecosystem":"Ubuntu:Pro:16.04:LTS","purl":"pkg:deb/ubuntu/mupdf?arch=source&distro=esm-apps%2Fxenial"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["1.7-1","1.7a-1","1.7a-1ubuntu0.1~esm1"],"ecosystem_specific":{"binaries":[{"binary_name":"mupdf","binary_version":"1.7a-1ubuntu0.1~esm1"},{"binary_name":"mupdf-tools","binary_version":"1.7a-1ubuntu0.1~esm1"}]},"database_specific":{"source":"https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-40505.json"}},{"package":{"name":"mupdf","ecosystem":"Ubuntu:Pro:18.04:LTS","purl":"pkg:deb/ubuntu/mupdf?arch=source&distro=esm-apps%2Fbionic"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["1.11+ds1-1.1","1.11+ds1-2","1.12.0+ds1-1","1.12.0+ds1-1ubuntu0.1~esm1","1.12.0+ds1-1ubuntu0.1~esm2"],"ecosystem_specific":{"binaries":[{"binary_name":"mupdf","binary_version":"1.12.0+ds1-1ubuntu0.1~esm2"},{"binary_version":"1.12.0+ds1-1ubuntu0.1~esm2","binary_name":"mupdf-tools"}]},"database_specific":{"source":"https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-40505.json"}},{"package":{"name":"mupdf","ecosystem":"Ubuntu:Pro:20.04:LTS","purl":"pkg:deb/ubuntu/mupdf?arch=source&distro=esm-apps%2Ffocal"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["1.15.0+ds1-1","1.16.1+ds1-1ubuntu1","1.16.1+ds1-1ubuntu1+esm1","1.16.1+ds1-1ubuntu1+esm2"],"ecosystem_specific":{"binaries":[{"binary_name":"mupdf","binary_version":"1.16.1+ds1-1ubuntu1+esm2"},{"binary_version":"1.16.1+ds1-1ubuntu1+esm2","binary_name":"mupdf-tools"}]},"database_specific":{"source":"https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-40505.json"}},{"package":{"name":"mupdf","ecosystem":"Ubuntu:Pro:22.04:LTS","purl":"pkg:deb/ubuntu/mupdf?arch=source&distro=esm-apps%2Fjammy"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["1.17.0+ds1-2","1.19.0+ds1-1","1.19.0+ds1-1build1","1.19.0+ds1-2","1.19.0+ds1-2ubuntu0.1~esm1"],"ecosystem_specific":{"binaries":[{"binary_name":"mupdf","binary_version":"1.19.0+ds1-2ubuntu0.1~esm1"},{"binary_name":"mupdf-tools","binary_version":"1.19.0+ds1-2ubuntu0.1~esm1"}]},"database_specific":{"source":"https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-40505.json"}},{"package":{"name":"mupdf","ecosystem":"Ubuntu:Pro:24.04:LTS","purl":"pkg:deb/ubuntu/mupdf?arch=source&distro=esm-apps%2Fnoble"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["1.22.2+ds1-2","1.22.2+ds1-2build1","1.23.6+ds1-1","1.23.7+ds1-1","1.23.10+ds1-1","1.23.10+ds1-1build1","1.23.10+ds1-1build2","1.23.10+ds1-1build3","1.23.10+ds1-1ubuntu0.1~esm1"],"ecosystem_specific":{"binaries":[{"binary_version":"1.23.10+ds1-1ubuntu0.1~esm1","binary_name":"mupdf"},{"binary_name":"mupdf-tools","binary_version":"1.23.10+ds1-1ubuntu0.1~esm1"}]},"database_specific":{"source":"https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-40505.json"}},{"package":{"name":"mupdf","ecosystem":"Ubuntu:25.10","purl":"pkg:deb/ubuntu/mupdf?arch=source&distro=questing"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["1.25.1+ds1-5build2","1.25.1+ds1-6","1.25.1+ds1-7"],"ecosystem_specific":{"binaries":[{"binary_name":"libmupdf25.1","binary_version":"1.25.1+ds1-7"},{"binary_name":"mupdf","binary_version":"1.25.1+ds1-7"},{"binary_name":"mupdf-tools","binary_version":"1.25.1+ds1-7"},{"binary_name":"python3-mupdf","binary_version":"1.25.1+ds1-7"}]},"database_specific":{"source":"https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-40505.json"}},{"package":{"name":"mupdf","ecosystem":"Ubuntu:26.04:LTS","purl":"pkg:deb/ubuntu/mupdf?arch=source&distro=resolute"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["1.25.1+ds1-7","1.25.1+ds1-7build1","1.25.1+ds1-7build2","1.27.0+ds1-2ubuntu1","1.27.0+ds1-3ubuntu1","1.27.0+ds1-3ubuntu2"],"ecosystem_specific":{"binaries":[{"binary_name":"libmupdf27.0","binary_version":"1.27.0+ds1-3ubuntu2"},{"binary_name":"mupdf","binary_version":"1.27.0+ds1-3ubuntu2"},{"binary_version":"1.27.0+ds1-3ubuntu2","binary_name":"mupdf-tools"},{"binary_name":"python3-mupdf","binary_version":"1.27.0+ds1-3ubuntu2"}]},"database_specific":{"source":"https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-40505.json"}}],"schema_version":"1.7.5","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:N"},{"type":"CVSS_V4","score":"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"},{"type":"Ubuntu","score":"medium"}]}