Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 907385 (CVE-2023-2804)

Summary: <media-libs/libjpeg-turbo-3.0.0: buffer overflow in lossless 12-bit image parsing
Product: Gentoo Security Reporter: John Helmert III <ajak>
Component: VulnerabilitiesAssignee: Gentoo Security <security>
Status: CONFIRMED ---    
Severity: normal CC: codec
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard: A3 [stable]
Package list:
Runtime testing required: ---
Bug Depends on: 913822    
Bug Blocks:    

Description John Helmert III archtester Gentoo Infrastructure gentoo-dev Security 2023-05-29 20:37:15 UTC
CVE-2023-2804 (https://github.com/libjpeg-turbo/libjpeg-turbo/issues/668#issuecomment-1492586118):

A heap-based buffer overflow issue was discovered in libjpeg-turbo in h2v2_merged_upsample_internal() function of jdmrgext.c file. The vulnerability can only be exploited with 12-bit data precision for which the range of the sample data type exceeds the valid sample range, hence, an attacker could craft a 12-bit lossless JPEG image that contains out-of-range 12-bit samples. An application attempting to decompress such image using merged upsampling would lead to segmentation fault or buffer overflows, causing an application to crash.

Patched in main: https://github.com/libjpeg-turbo/libjpeg-turbo/commit/9f756bc67a84d4566bf74a0c2432aa55da404021
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-06-17 02:39:50 UTC
I don't get why, but we don't seem to have jdlossls.c in our /var/tmp/portage/media-libs/libjpeg-turbo-2.1.5.1-r1/work/libjpeg-turbo-2.1.5.1.

Maybe I'm too tired :)
Comment 2 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-07-05 04:27:30 UTC
The 3.0.0 release notes mention this, but it's currently unkw'd because of test failures:

commit 626886cfd7f73d2440495ac1b8613b0eff27dbfa
Author: Sam James <sam@gentoo.org>
Date:   Mon Jul 3 21:38:15 2023 +0100

    media-libs/libjpeg-turbo: add 3.0.0 (unkeyworded)

    Unkeyworded because of test failures.

    Signed-off-by: Sam James <sam@gentoo.org>