From cb927006747b797aa9163cd0cbd41b9bbdf05db0 Mon Sep 17 00:00:00 2001 From: Till Kamppeter Date: Mon, 10 Nov 2025 18:50:10 +0100 Subject: [PATCH] Reject images with planar color configuration 4. fix for CVE-2025-57812 --- cupsfilters/image-tiff.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/cupsfilters/image-tiff.c b/cupsfilters/image-tiff.c index a207f7ce9..04ec0719a 100644 --- a/cupsfilters/image-tiff.c +++ b/cupsfilters/image-tiff.c @@ -43,6 +43,7 @@ _cupsImageReadTIFF( TIFF *tif; /* TIFF file */ uint32_t width, height; /* Size of image */ uint16_t photometric, /* Colorspace */ + planar, /* Color components in separate planes */ compression, /* Type of compression */ orientation, /* Orientation */ resunit, /* Units for resolution */ @@ -115,6 +116,15 @@ _cupsImageReadTIFF( return (-1); } + if (TIFFGetField(tif, TIFFTAG_PLANARCONFIG, &planar) && + planar == PLANARCONFIG_SEPARATE) + { + fputs("DEBUG: Images with planar color configuration are not supported!\n", stderr); + TIFFClose(tif); + fclose(fp); + return (1); + } + if (!TIFFGetField(tif, TIFFTAG_COMPRESSION, &compression)) { fputs("DEBUG: No compression tag in the file!\n", stderr);