---
id: CVE-2026-77219
title: >-
  GNU Emacs before 31.0.91 contains an integer overflow in the PBM/PPM/PGM image
  loader that allows an attacker to leak heap memory contents by supplying a
  crafted image with large dimensions and an elevated max color index
summary: >-
  GNU Emacs before 31.0.91 contains an integer overflow in the PBM/PPM/PGM image
  loader that allows an attacker to leak heap memory contents by supplying a
  crafted image with large dimensions and an elevated max color index. The image
  load…
severity: high
cvss: 7.1
cvssVector: 'CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:H'
cwe:
  - CWE-125
  - CWE-190
vendor: GNU
product: Emacs
affected:
  - Emacs < 31.0.91
published: '2026-08-21'
updated: '2026-10-12'
sourceUpdated: '2026-10-12T16:10:00.220'
source: NVD
sourceUrl: 'https://nvd.nist.gov/vuln/detail/CVE-2026-77219'
references:
  - url: 'https://debbugs.gnu.org/cgi/bugreport.cgi?bug=81344'
    label: disclosure@vulncheck.com
  - url: >-
      https://github.com/emacs-mirror/emacs/commit/b07e634e4cf45162ae0178e32092b040587f2c6c
    label: disclosure@vulncheck.com
  - url: 'https://github.com/emacs-mirror/emacs/releases/tag/emacs-31.0.91'
    label: disclosure@vulncheck.com
  - url: >-
      https://www.vulncheck.com/advisories/gnu-emacs-heap-over-read-via-pbm-ppm-pgm-image-loader
    label: disclosure@vulncheck.com
  - url: >-
      https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-77219.json
  - url: 'https://access.redhat.com/security/cve/CVE-2026-77219'
  - url: 'https://bugzilla.redhat.com/show_bug.cgi?id=2521196'
  - url: 'https://www.cve.org/CVERecord?id=CVE-2026-77219'
  - url: 'https://nvd.nist.gov/vuln/detail/CVE-2026-77219'
  - url: 'https://access.redhat.com/errata/RHSA-2026:84591'
  - url: 'https://access.redhat.com/errata/RHSA-2026:80506'
  - url: 'https://access.redhat.com/errata/RHSA-2026:80507'
tags:
  - nvd
  - cve.org
  - csaf
  - vex
  - red-hat
epss: 0.00128
epssPercentile: 0.02462
ssvc:
  exploitation: none
  automatable: 'no'
  technicalImpact: partial
  timestamp: '2026-08-21T21:32:45.496424Z'
ingestedAt: '2026-09-24T20:51:40.217Z'
patched:
  - enterprise_linux_appstream_v_10
  - enterprise_linux_appstream_v_8
  - enterprise_linux_appstream_v_9
  - enterprise_linux_baseos_v_10
  - enterprise_linux_baseos_v_8
---

## Overview

GNU Emacs before 31.0.91 contains an integer overflow in the PBM/PPM/PGM image loader that allows an attacker to leak heap memory contents by supplying a crafted image with large dimensions and an elevated max color index. The image loader multiplies image dimensions and channel count using signed integer arithmetic; for sufficiently large values, the result wraps to a negative number, bypassing the bounds check and causing the pixel reader to access heap memory past the end of the allocated buffer. The over-read contents are interpreted as pixel color values and rendered on screen.

## Remediation

Refer to the linked advisories for vendor-supplied fixes and affected version ranges.

## Vendor advisories

- **RHSA-2026:84591** · Red Hat · fixed in: Red Hat Enterprise Linux AppStream (v. 10), Red Hat Enterprise Linux BaseOS (v. 10) · released 2026-10-19 · [advisory](https://access.redhat.com/errata/RHSA-2026:84591)
- **RHSA-2026:80506** · Red Hat · fixed in: Red Hat Enterprise Linux AppStream (v. 8), Red Hat Enterprise Linux BaseOS (v. 8) · released 2026-10-12 · [advisory](https://access.redhat.com/errata/RHSA-2026:80506)
- **RHSA-2026:80507** · Red Hat · fixed in: Red Hat Enterprise Linux AppStream (v. 9) · released 2026-10-12 · [advisory](https://access.redhat.com/errata/RHSA-2026:80507)
- **Red Hat VEX** · Important · affected: Red Hat Enterprise Linux 6, Red Hat Enterprise Linux 7 · no fix planned: Red Hat Enterprise Linux 6, Red Hat Enterprise Linux 7 · updated 2026-10-19 · [vex](https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-77219.json)
