Skip to contentSkip to conversation

tiff: fix CVE-2023-52356 CVE-2023-6277

PATCH New [email protected] 1 participant 1 message Apr 1, 2024

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 tiff: fix CVE-2023-52356 CVE-2023-6277

From: Lee Chee Yang <[email protected]>

import patch from ubuntu to fix CVE-2023-52356 CVE-2023-6277 import from
http://archive.ubuntu.com/ubuntu/pool/main/t/tiff/tiff_4.3.0-6ubuntu0.8.debian.tar.xz

---
v2: fix Upstream-Status format

 .../libtiff/tiff/CVE-2023-52356.patch         |  54 ++++++
 .../libtiff/tiff/CVE-2023-6277-1.patch        | 178 ++++++++++++++++++
 .../libtiff/tiff/CVE-2023-6277-2.patch        | 151 +++++++++++++++
 .../libtiff/tiff/CVE-2023-6277-3.patch        |  46 +++++
 .../libtiff/tiff/CVE-2023-6277-4.patch        |  93 +++++++++
 meta/recipes-multimedia/libtiff/tiff_4.3.0.bb |   5 +
 6 files changed, 527 insertions(+)
 create mode 100644 meta/recipes-multimedia/libtiff/tiff/CVE-2023-52356.patch
 create mode 100644 meta/recipes-multimedia/libtiff/tiff/CVE-2023-6277-1.patch
 create mode 100644 meta/recipes-multimedia/libtiff/tiff/CVE-2023-6277-2.patch
 create mode 100644 meta/recipes-multimedia/libtiff/tiff/CVE-2023-6277-3.patch
 create mode 100644 meta/recipes-multimedia/libtiff/tiff/CVE-2023-6277-4.patch
meta/recipes-multimedia/libtiff/tiff/CVE-2023-52356.patch new file +54 -0
new file mode 100644
index 0000000000..4eb7d79c8f
@@ -0,0 +1,54 @@
+CVE: CVE-2023-52356
+Upstream-Status: Backport [upstream : https://gitlab.com/libtiff/libtiff/-/commit/51558511bdbbcffdce534db21dbaf5d54b31638a 
+ubuntu : http://archive.ubuntu.com/ubuntu/pool/main/t/tiff/tiff_4.3.0-6ubuntu0.8.debian.tar.xz ]
+Signed-off-by: Lee Chee Yang <[email protected]>
+
+[Ubuntu note: Backport of the following patch from upstream, with a few changes
+to match the current version of the file in the present Ubuntu release:
+ . using TIFFErrorExt instead of TIFFErrorExtR (the latter did not exist yet);
+-- Rodrigo Figueiredo Zaiden]
+
+Backport of:
+
+From 51558511bdbbcffdce534db21dbaf5d54b31638a Mon Sep 17 00:00:00 2001
+From: Even Rouault <[email protected]>
+Date: Tue, 31 Oct 2023 15:58:41 +0100
+Subject: [PATCH] TIFFReadRGBAStrip/TIFFReadRGBATile: add more validation of
+ col/row (fixes #622)
+
+---
+ libtiff/tif_getimage.c | 15 +++++++++++++++
+ 1 file changed, 15 insertions(+)
+
+
+--- tiff-4.3.0.orig/libtiff/tif_getimage.c
++++ tiff-4.3.0/libtiff/tif_getimage.c
+@@ -2942,6 +2942,13 @@ TIFFReadRGBAStripExt(TIFF* tif, uint32_t
+     }
+ 
+     if (TIFFRGBAImageOK(tif, emsg) && TIFFRGBAImageBegin(&img, tif, stop_on_error, emsg)) {
++        if (row >= img.height)
++        {
++            TIFFErrorExt(tif->tif_clientdata, TIFFFileName(tif),
++                          "Invalid row passed to TIFFReadRGBAStrip().");
++            TIFFRGBAImageEnd(&img);
++            return (0);
++        }
+ 
+         img.row_offset = row;
+         img.col_offset = 0;
+@@ -3018,6 +3025,14 @@ TIFFReadRGBATileExt(TIFF* tif, uint32_t
+ 	    return( 0 );
+     }
+ 
++    if (col >= img.width || row >= img.height)
++    {
++        TIFFErrorExt(tif->tif_clientdata, TIFFFileName(tif),
++                      "Invalid row/col passed to TIFFReadRGBATile().");
++        TIFFRGBAImageEnd(&img);
++        return (0);
++    }
++
+     /*
+      * The TIFFRGBAImageGet() function doesn't allow us to get off the
+      * edge of the image, even to fill an otherwise valid tile.  So we
meta/recipes-multimedia/libtiff/tiff/CVE-2023-6277-1.patch new file +178 -0

178 lines not on this page · raw message

meta/recipes-multimedia/libtiff/tiff/CVE-2023-6277-2.patch new file +151 -0

151 lines not on this page · raw message

meta/recipes-multimedia/libtiff/tiff/CVE-2023-6277-3.patch new file +46 -0

46 lines not on this page · raw message

meta/recipes-multimedia/libtiff/tiff/CVE-2023-6277-4.patch new file +93 -0

93 lines not on this page · raw message

meta/recipes-multimedia/libtiff/tiff_4.3.0.bb +5 -0
index d284100ab2..b4af179e76 100644
@@ -48,6 +48,11 @@ SRC_URI = "http://download.osgeo.org/libtiff/tiff-${PV}.tar.gz \
            file://CVE-2023-40745.patch \
            file://CVE-2023-41175.patch \
            file://CVE-2023-6228.patch \
+           file://CVE-2023-52356.patch \
+           file://CVE-2023-6277-1.patch \
+           file://CVE-2023-6277-2.patch \
+           file://CVE-2023-6277-3.patch \
+           file://CVE-2023-6277-4.patch \
            "
 
 SRC_URI[sha256sum] = "0e46e5acb087ce7d1ac53cf4f56a09b221537fc86dfc5daaad1c2e89e1b37ac8"
Signature · 1 line
2.37.3