REDHAT-BUG-2521196: Integer Overflow
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.
Affected Software
Event History
Frequently Asked Questions
What must an attacker provide to trigger the issue?
The attacker must supply a crafted PBM, PPM, or PGM image with sufficiently large dimensions and an elevated maximum color index. Exploitation relies on the image loader processing values that cause signed integer arithmetic to wrap.
What is the practical impact of successful exploitation?
Successful exploitation can disclose heap memory contents. The out-of-bounds data is interpreted as pixel color values and rendered on screen.
Which GNU Emacs versions are affected?
GNU Emacs versions before 31.0.91 are affected, based on the available information.