Skip to content
Heist/ feed
Back to feed
Medium

mupdf — security advisory

Type: advisorySources: OSVAdvisory ID: UBUNTU-CVE-2026-40505

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.

Products
mupdf
Affected 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, 1.15.0+ds1-1, 1.16.1+ds1-1ubuntu1, 1.16.1+ds1-1ubuntu1+esm1, 1.16.1+ds1-1ubuntu1+esm2, 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, 1.22.2+ds1-2, 1.22.2+ds1-2build1, 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, 1.23.6+ds1-1, 1.23.7+ds1-1, 1.25.1+ds1-5build2, 1.25.1+ds1-6, 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, 1.27.0+ds1-3ubuntu3, 1.7-1, 1.7a-1, 1.7a-1ubuntu0.1~esm1
Fixed versions
Not specified
CVEs
CVE-2026-40505
Confirmed fixed CVEs
Not specified
Updated in this feed
31 Oct 2026, 02:43 UTC · Revision 1

Source evidence

UBUNTU-CVE-2026-40505

core-osv · Original source

Published 16 Apr 2026, 02:16 UTC

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.

osv:UBUNTU-CVE-2026-40505

mupdf

Fixed versions: Not specified

mupdf

Fixed versions: Not specified

mupdf

Fixed versions: Not specified

mupdf

Fixed versions: Not specified

mupdf

Fixed versions: Not specified

mupdf

Fixed versions: Not specified

mupdf

Fixed versions: Not specified

mupdf

Fixed versions: Not specified

Complete source record
{
  "id": "c4d273f925d45d5a9e4b98d196f0d826284c36b5666ba1f18b8ceee945ac1b74",
  "url": "https://osv.dev/vulnerability/UBUNTU-CVE-2026-40505",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "UBUNTU-CVE-2026-40505",
    "summary": "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.",
    "evidence": "osv:UBUNTU-CVE-2026-40505",
    "products": [
      {
        "name": {
          "value": "mupdf",
          "evidence": "/affected/0/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "1.7-1",
            "evidence": "/affected/0/versions"
          },
          {
            "value": "1.7a-1",
            "evidence": "/affected/0/versions"
          },
          {
            "value": "1.7a-1ubuntu0.1~esm1",
            "evidence": "/affected/0/versions"
          }
        ]
      },
      {
        "name": {
          "value": "mupdf",
          "evidence": "/affected/1/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "1.11+ds1-1.1",
            "evidence": "/affected/1/versions"
          },
          {
            "value": "1.11+ds1-2",
            "evidence": "/affected/1/versions"
          },
          {
            "value": "1.12.0+ds1-1",
            "evidence": "/affected/1/versions"
          },
          {
            "value": "1.12.0+ds1-1ubuntu0.1~esm1",
            "evidence": "/affected/1/versions"
          },
          {
            "value": "1.12.0+ds1-1ubuntu0.1~esm2",
            "evidence": "/affected/1/versions"
          }
        ]
      },
      {
        "name": {
          "value": "mupdf",
          "evidence": "/affected/2/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "1.15.0+ds1-1",
            "evidence": "/affected/2/versions"
          },
          {
            "value": "1.16.1+ds1-1ubuntu1",
            "evidence": "/affected/2/versions"
          },
          {
            "value": "1.16.1+ds1-1ubuntu1+esm1",
            "evidence": "/affected/2/versions"
          },
          {
            "value": "1.16.1+ds1-1ubuntu1+esm2",
            "evidence": "/affected/2/versions"
          }
        ]
      },
      {
        "name": {
          "value": "mupdf",
          "evidence": "/affected/3/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "1.17.0+ds1-2",
            "evidence": "/affected/3/versions"
          },
          {
            "value": "1.19.0+ds1-1",
            "evidence": "/affected/3/versions"
          },
          {
            "value": "1.19.0+ds1-1build1",
            "evidence": "/affected/3/versions"
          },
          {
            "value": "1.19.0+ds1-2",
            "evidence": "/affected/3/versions"
          },
          {
            "value": "1.19.0+ds1-2ubuntu0.1~esm1",
            "evidence": "/affected/3/versions"
          }
        ]
      },
      {
        "name": {
          "value": "mupdf",
          "evidence": "/affected/4/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "1.22.2+ds1-2",
            "evidence": "/affected/4/versions"
          },
          {
            "value": "1.22.2+ds1-2build1",
            "evidence": "/affected/4/versions"
          },
          {
            "value": "1.23.6+ds1-1",
            "evidence": "/affected/4/versions"
          },
          {
            "value": "1.23.7+ds1-1",
            "evidence": "/affected/4/versions"
          },
          {
            "value": "1.23.10+ds1-1",
            "evidence": "/affected/4/versions"
          },
          {
            "value": "1.23.10+ds1-1build1",
            "evidence": "/affected/4/versions"
          },
          {
            "value": "1.23.10+ds1-1build2",
            "evidence": "/affected/4/versions"
          },
          {
            "value": "1.23.10+ds1-1build3",
            "evidence": "/affected/4/versions"
          },
          {
            "value": "1.23.10+ds1-1ubuntu0.1~esm1",
            "evidence": "/affected/4/versions"
          }
        ]
      },
      {
        "name": {
          "value": "mupdf",
          "evidence": "/affected/5/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "1.25.1+ds1-5build2",
            "evidence": "/affected/5/versions"
          },
          {
            "value": "1.25.1+ds1-6",
            "evidence": "/affected/5/versions"
          },
          {
            "value": "1.25.1+ds1-7",
            "evidence": "/affected/5/versions"
          }
        ]
      },
      {
        "name": {
          "value": "mupdf",
          "evidence": "/affected/6/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "1.27.0+ds1-3ubuntu2",
            "evidence": "/affected/6/versions"
          },
          {
            "value": "1.27.0+ds1-3ubuntu3",
            "evidence": "/affected/6/versions"
          }
        ]
      },
      {
        "name": {
          "value": "mupdf",
          "evidence": "/affected/7/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "1.25.1+ds1-7",
            "evidence": "/affected/7/versions"
          },
          {
            "value": "1.25.1+ds1-7build1",
            "evidence": "/affected/7/versions"
          },
          {
            "value": "1.25.1+ds1-7build2",
            "evidence": "/affected/7/versions"
          },
          {
            "value": "1.27.0+ds1-2ubuntu1",
            "evidence": "/affected/7/versions"
          },
          {
            "value": "1.27.0+ds1-3ubuntu1",
            "evidence": "/affected/7/versions"
          },
          {
            "value": "1.27.0+ds1-3ubuntu2",
            "evidence": "/affected/7/versions"
          }
        ]
      }
    ],
    "severity": "medium",
    "structured": {
      "id": "UBUNTU-CVE-2026-40505",
      "aliases": [
        "UBUNTU-CVE-2026-40505"
      ],
      "metrics": [
        {
          "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"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "mupdf",
            "purl": "pkg:deb/ubuntu/mupdf?arch=source&distro=esm-apps%2Fxenial",
            "ecosystem": "Ubuntu:Pro:16.04:LTS"
          },
          "versions": [
            "1.7-1",
            "1.7a-1",
            "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"
          },
          "ecosystem_specific": {
            "binaries": [
              {
                "binary_name": "mupdf",
                "binary_version": "1.7a-1ubuntu0.1~esm1"
              },
              {
                "binary_name": "mupdf-tools",
                "binary_version": "1.7a-1ubuntu0.1~esm1"
              }
            ]
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "mupdf",
            "purl": "pkg:deb/ubuntu/mupdf?arch=source&distro=esm-apps%2Fbionic",
            "ecosystem": "Ubuntu:Pro:18.04:LTS"
          },
          "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"
          ],
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-40505.json"
          },
          "ecosystem_specific": {
            "binaries": [
              {
                "binary_name": "mupdf",
                "binary_version": "1.12.0+ds1-1ubuntu0.1~esm2"
              },
              {
                "binary_name": "mupdf-tools",
                "binary_version": "1.12.0+ds1-1ubuntu0.1~esm2"
              }
            ]
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "mupdf",
            "purl": "pkg:deb/ubuntu/mupdf?arch=source&distro=esm-apps%2Ffocal",
            "ecosystem": "Ubuntu:Pro:20.04:LTS"
          },
          "versions": [
            "1.15.0+ds1-1",
            "1.16.1+ds1-1ubuntu1",
            "1.16.1+ds1-1ubuntu1+esm1",
            "1.16.1+ds1-1ubuntu1+esm2"
          ],
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-40505.json"
          },
          "ecosystem_specific": {
            "binaries": [
              {
                "binary_name": "mupdf",
                "binary_version": "1.16.1+ds1-1ubuntu1+esm2"
              },
              {
                "binary_name": "mupdf-tools",
                "binary_version": "1.16.1+ds1-1ubuntu1+esm2"
              }
            ]
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "mupdf",
            "purl": "pkg:deb/ubuntu/mupdf?arch=source&distro=esm-apps%2Fjammy",
            "ecosystem": "Ubuntu:Pro:22.04:LTS"
          },
          "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"
          ],
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-40505.json"
          },
          "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"
              }
            ]
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "mupdf",
            "purl": "pkg:deb/ubuntu/mupdf?arch=source&distro=esm-apps%2Fnoble",
            "ecosystem": "Ubuntu:Pro:24.04:LTS"
          },
          "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"
          ],
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-40505.json"
          },
          "ecosystem_specific": {
            "binaries": [
              {
                "binary_name": "mupdf",
                "binary_version": "1.23.10+ds1-1ubuntu0.1~esm1"
              },
              {
                "binary_name": "mupdf-tools",
                "binary_version": "1.23.10+ds1-1ubuntu0.1~esm1"
              }
            ]
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "mupdf",
            "purl": "pkg:deb/ubuntu/mupdf?arch=source&distro=questing",
            "ecosystem": "Ubuntu:25.10"
          },
          "versions": [
            "1.25.1+ds1-5build2",
            "1.25.1+ds1-6",
            "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"
          },
          "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"
              }
            ]
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "mupdf",
            "purl": "pkg:deb/ubuntu/mupdf?arch=source&distro=stonking",
            "ecosystem": "Ubuntu:26.10"
          },
          "versions": [
            "1.27.0+ds1-3ubuntu2",
            "1.27.0+ds1-3ubuntu3"
          ],
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-40505.json"
          },
          "ecosystem_specific": {
            "binaries": [
              {
                "binary_name": "libmupdf27.0",
                "binary_version": "1.27.0+ds1-3ubuntu3"
              },
              {
                "binary_name": "mupdf",
                "binary_version": "1.27.0+ds1-3ubuntu3"
              },
              {
                "binary_name": "mupdf-tools",
                "binary_version": "1.27.0+ds1-3ubuntu3"
              },
              {
                "binary_name": "python3-mupdf",
                "binary_version": "1.27.0+ds1-3ubuntu3"
              }
            ]
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "mupdf",
            "purl": "pkg:deb/ubuntu/mupdf?arch=source&distro=resolute",
            "ecosystem": "Ubuntu:26.04:LTS"
          },
          "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"
          ],
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-40505.json"
          },
          "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_name": "mupdf-tools",
                "binary_version": "1.27.0+ds1-3ubuntu2"
              },
              {
                "binary_name": "python3-mupdf",
                "binary_version": "1.27.0+ds1-3ubuntu2"
              }
            ]
          }
        }
      ],
      "modified": "2026-10-17T12:58:53.488415895Z",
      "provider": "osv",
      "upstream": [
        "CVE-2026-40505"
      ],
      "references": [
        "https://ubuntu.com/security/CVE-2026-40505",
        "https://www.cve.org/CVERecord?id=CVE-2026-40505",
        "https://cgit.ghostscript.com/cgi-bin/cgit.cgi/mupdf.git/commit/?id=0f17d789fe8c29b41e47663be82514aaca3a4dfb",
        "https://bugs.ghostscript.com/show_bug.cgi?id=709108"
      ]
    },
    "related_cves": [
      {
        "value": "CVE-2026-40505",
        "evidence": "/upstream"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/1/score"
  },
  "source_id": "core-osv",
  "document_id": 359138,
  "published_at": "2026-04-16T02:16:00+00:00"
}