tiff: patch CVE-2025-61143
PATCH 1/3 tiff: patch CVE-2025-61143
From: Peter Marko <[email protected]>
Pick patch from merge request mentioned in NVD report.
Signed-off-by Peter Marko <[email protected]>
--- .../libtiff/tiff/CVE-2025-61143.patch | 44 +++++++++++++++++++ meta/recipes-multimedia/libtiff/tiff_4.3.0.bb | 1 + 2 files changed, 45 insertions(+) create mode 100644 meta/recipes-multimedia/libtiff/tiff/CVE-2025-61143.patch
meta/recipes-multimedia/libtiff/tiff/CVE-2025-61143.patch new file +44 -0
@@ -0,0 +1,44 @@ +From 4d28af5fe61b1760f10981f5072ff1e6fd44f210 Mon Sep 17 00:00:00 2001 +From: Lee Howard <[email protected]> +Date: Fri, 5 Sep 2025 21:44:49 +0000 +Subject: [PATCH] tiffcrop: avoid nullptr dereference + +Fixes #734 + +CVE: CVE-2025-61143 +Upstream-Status: Backport [https://gitlab.com/libtiff/libtiff/-/commit/4d28af5fe61b1760f10981f5072ff1e6fd44f210] +Signed-off-by: Peter Marko <[email protected]> +--- + tools/tiffcrop.c | 2 +- + tools/tiffdither.c | 5 +++++ + 2 files changed, 6 insertions(+), 1 deletion(-) + +diff --git a/tools/tiffcrop.c b/tools/tiffcrop.c +index ae414efc..1cbb49b6 100644 +--- a/tools/tiffcrop.c ++++ b/tools/tiffcrop.c +@@ -2561,7 +2561,7 @@ main(int argc, char* argv[]) + + if (dump.outfile != NULL) + { +- dump_info (dump.outfile, dump.format, "", "Completed run for %s", TIFFFileName(out)); ++ dump_info (dump.outfile, dump.format, "", "Completed run for %s", out ? TIFFFileName(out) : "(not opened)"); + fclose (dump.outfile); + } + } +diff --git a/tools/tiffdither.c b/tools/tiffdither.c +index 3c64fdc0..405527c7 100644 +--- a/tools/tiffdither.c ++++ b/tools/tiffdither.c +@@ -84,6 +84,11 @@ fsdither(TIFF* in, TIFF* out) + fprintf(stderr, "Out of memory.\n"); + goto skip_on_error; + } ++ if (imagewidth > TIFFScanlineSize(in)) ++ { ++ fprintf(stderr, "Image width exceeds scanline size.\n"); ++ goto skip_on_error; ++ } + + /* + * Get first line
meta/recipes-multimedia/libtiff/tiff_4.3.0.bb +1 -0
@@ -65,6 +65,7 @@ SRC_URI = "http://download.osgeo.org/libtiff/tiff-${PV}.tar.gz \ file://CVE-2025-9900.patch \ file://CVE-2025-8961.patch \ file://CVE-2025-9165.patch \ + file://CVE-2025-61143.patch \ " SRC_URI[sha256sum] = "0e46e5acb087ce7d1ac53cf4f56a09b221537fc86dfc5daaad1c2e89e1b37ac8"
PATCH 2/3 tiff: patch CVE-2025-61144
From: Peter Marko <[email protected]>
Pick patch from merge request mentioned in NVD report.
Signed-off-by Peter Marko <[email protected]>
--- .../libtiff/tiff/CVE-2025-61144.patch | 27 +++++++++++++++++++ meta/recipes-multimedia/libtiff/tiff_4.3.0.bb | 1 + 2 files changed, 28 insertions(+) create mode 100644 meta/recipes-multimedia/libtiff/tiff/CVE-2025-61144.patch
meta/recipes-multimedia/libtiff/tiff/CVE-2025-61144.patch new file +27 -0
@@ -0,0 +1,27 @@ +From 88cf9dbb48f6e172629795ecffae35d5052f68aa Mon Sep 17 00:00:00 2001 +From: Lee Howard <[email protected]> +Date: Fri, 5 Sep 2025 21:46:03 +0000 +Subject: [PATCH] tiffcrop: avoid buffer overflow + +Fixes #740 + +CVE: CVE-2025-61144 +Upstream-Status: Backport [https://gitlab.com/libtiff/libtiff/-/commit/88cf9dbb48f6e172629795ecffae35d5052f68aa] +Signed-off-by: Peter Marko <[email protected]> +--- + tools/tiffcrop.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/tools/tiffcrop.c b/tools/tiffcrop.c +index ae414efc..afa1cce5 100644 +--- a/tools/tiffcrop.c ++++ b/tools/tiffcrop.c +@@ -3913,7 +3913,7 @@ combineSeparateSamplesBytes (unsigned char *srcbuffs[], unsigned char *out, + { + if ((dumpfile != NULL) && (level == 2)) + { +- for (s = 0; s < spp; s++) ++ for (s = 0; (s < spp) && (s < MAX_SAMPLES); s++) + { + dump_info (dumpfile, format, "combineSeparateSamplesBytes","Input data, Sample %"PRIu16, s); + dump_buffer(dumpfile, format, 1, cols, row, srcbuffs[s] + (row * src_rowsize));
meta/recipes-multimedia/libtiff/tiff_4.3.0.bb +1 -0
@@ -66,6 +66,7 @@ SRC_URI = "http://download.osgeo.org/libtiff/tiff-${PV}.tar.gz \ file://CVE-2025-8961.patch \ file://CVE-2025-9165.patch \ file://CVE-2025-61143.patch \ + file://CVE-2025-61144.patch \ " SRC_URI[sha256sum] = "0e46e5acb087ce7d1ac53cf4f56a09b221537fc86dfc5daaad1c2e89e1b37ac8"
PATCH 3/3 tiff: set status of CVE-2025-61145 as fixed by patch for CVE-2025-8961
In reply to Peter MarkoFrom: Peter Marko <[email protected]>
Gitlab issues for these two CVEs mentioned in NVD inks lead to the same merge request.
Signed-off-by Peter Marko <[email protected]>
--- meta/recipes-multimedia/libtiff/tiff/CVE-2025-8961.patch | 1 + 1 file changed, 1 insertion(+)
meta/recipes-multimedia/libtiff/tiff/CVE-2025-8961.patch +1 -0
@@ -6,6 +6,7 @@ Subject: [PATCH] tiffcrop: fix double-free and memory leak exposed by issue Upstream-Status: Backport [https://gitlab.com/libtiff/libtiff/-/commit/0ac97aa7a5bffddd88f7cdbe517264e9db3f5bd5] CVE: CVE-2025-8961 +CVE: CVE-2025-61145 Signed-off-by: Vijay Anusuri <[email protected]> --- tools/tiffcrop.c | 8 +++++++-