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
I don't get why, but we don't seem to have jdlossls.c in our /var/tmp/portage/media-libs/libjpeg-turbo-188.8.131.52-r1/work/libjpeg-turbo-184.108.40.206.
Maybe I'm too tired :)
The 3.0.0 release notes mention this, but it's currently unkw'd because of test failures:
Author: Sam James <firstname.lastname@example.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 <email@example.com>