CVE-2026-77219

GNU Emacs < 31.0.91 Heap Over-Read via PBM/PPM/PGM Image Loader

Published Aug 21, 2026 CVSS 4.0 · 6.9 Medium EPSS < 1% KEV · Not listed
Description
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.

Analysis

AI-generated

Technical impact

The vulnerability is caused by an integer overflow in the PBM/PPM/PGM image loader of GNU Emacs. The loader calculates buffer size by multiplying image dimensions and channel count with signed integer arithmetic. When the dimensions and color index are large enough, the multiplication overflows to a negative number, bypassing bounds checking. This causes the pixel reader to reference memory past the allocated buffer, leaking contents of the as pixel color values that are rendered on screen. The result is a clear‑text disclosure of arbitrary heap data. The weakness maps to CWE-125 and CWE-190.

Affected Systems

GNU Emacs installations with a version earlier than 31.0.91 are affected. The vulnerability is present in all releases prior to the 31.0.91 release, which contains the fix. Users of older Emacs versions or custom builds that have not incorporated the patch are at risk.

Risk and Exploitability

The CVSS score of 6.9 indicates a moderate severity weakness with potential for significant information leakage. No EPSS score is available, so the probability of exploitation is unknown, and the vulnerability is not listed in CISA’s KEV catalog. The likely attack vector is local: an attacker supplies a crafted image file with large dimensions and an elevated max color index, which forces the Emacs process to load the image. When the image loader performs the signed multiplication, the resulting overflow causes an out‑of‑bounds memory read, and the over‑read heap contents are interpreted as pixel colors and rendered on the screen.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade GNU Emacs to version 31.0.91 or later, which incorporates the integer‑overflow fix.
  • If an upgrade cannot be performed immediately, avoid loading untrusted PBM/PPM/PGM images from untrusted sources, or use file system permissions to restrict access to image directories.
  • Apply the backported source patch found in commit b07e634e4cf45162ae0178e32092b040587f2c6c to custom builds or if re‑compiling Emacs.

Generated by OpenCVE AI on August 21, 2026 at 22:20 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
CPEs cpe:2.3:a:gnu:emacs:*:*:*:*:*:*:*:*
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
First Time appeared Gnu
Gnu emacs
Vendors & Products Gnu
Gnu emacs
Type Values Removed Values Added
Description 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.
Title GNU Emacs < 31.0.91 Heap Over-Read via PBM/PPM/PGM Image Loader
Weaknesses CWE-125
CWE-190
References
Metrics cvssV3_1

{'score': 7.1, 'vector': 'CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:H'}

cvssV4_0

{'score': 6.9, 'vector': 'CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:P/VC:H/VI:N/VA:H/SC:N/SI:N/SA:N'}

Weaknesses

Sources

Status
PUBLISHED
Assigner
VulnCheck
Published
Updated
Nov 8, 2026, 2:08 PM
Reserved
Aug 20, 2026, 6:25 PM
Status
Deferred
Published
Aug 21, 2026, 9:17 PM
Modified
Oct 12, 2026, 4:10 PM
Severity
Important
Public date
Aug 21, 2026, 8:20 PM