CVE-2021-46822
libjpeg-turbo: heap buffer overflow in get_word_rgb_row() in rdppm.c
Severity
ModerateRed Hat Product Security
CVSS 3.1
Review impact separately from score.
Published · April 7, 2021
Updated · November 21, 2025
Description
A heap-based buffer overflow vulnerability was found in libjpeg-turbo in the get_word_rgb_row() function in rdppm.c. The flaw occurs when the PPM reader in libjpeg-turbo mishandles use of the tjLoadImage() function for loading a 16-bit binary PPM file into a grayscale uncompressed image buffer and then loading a 16-bit binary PGM file into an RGB uncompressed image buffer. This flaw allows a remote attacker to persuade a victim to open a specially-crafted file, causing the application to crash.
Statement
The only way that users could potentially encounter these issues is through the tjLoadImage() function. TJBench and cjpeg are unaffected.
RHEL-8 ships libjpeg-turbo v1.5.3 which does not include vulnerable tjLoadImage() functionality.
CVSS score applicability
The CVSS score(s) listed for this vulnerability do not reflect the associated product's status, and are included for informational purposes to better understand the severity of this vulnerability.
Mitigation
No mitigation is specified in collected source.
CVSS / CWE
CVSS 3.1 · 5.5CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H
CWE-119 · Improper Restriction of Operations within the Bounds of a Memory Buffer