Skip to content

[AutoPR- Security] Patch libtiff for CVE-2025-8534 [LOW] #57

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: 3.0-dev
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 60 additions & 0 deletions SPECS/libtiff/CVE-2025-8534.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
From fc4ebc5b677362b31817f71e8c155d186f8efaa7 Mon Sep 17 00:00:00 2001
From: Su_Laus <[email protected]>
Date: Sat, 2 Aug 2025 18:55:54 +0200
Subject: [PATCH] tiff2ps: check return of TIFFGetFiled() for
TIFFTAG_STRIPBYTECOUNTS and TIFFTAG_TILEBYTECOUNTS to avoid NULL pointer
dereference.

Closes #718

Signed-off-by: Azure Linux Security Servicing Account <[email protected]>
Upstream-reference: https://gitlab.com/libtiff/libtiff/-/commit/6ba36f159fd396ad11bf6b7874554197736ecc8b.patch
---
tools/unsupported/tiff2ps.c | 20 +++++++++++++++++---
1 file changed, 17 insertions(+), 3 deletions(-)

diff --git a/tools/unsupported/tiff2ps.c b/tools/unsupported/tiff2ps.c
index 541495d..d6a54b4 100644
--- a/tools/unsupported/tiff2ps.c
+++ b/tools/unsupported/tiff2ps.c
@@ -2432,12 +2432,22 @@ int PS_Lvl2page(FILE *fd, TIFF *tif, uint32_t w, uint32_t h)
if (tiled_image)
{
num_chunks = TIFFNumberOfTiles(tif);
- TIFFGetField(tif, TIFFTAG_TILEBYTECOUNTS, &bc);
+ if (!TIFFGetField(tif, TIFFTAG_TILEBYTECOUNTS, &bc))
+ {
+ TIFFError(filename,
+ "Can't read bytecounts of tiles at PS_Lvl2page()");
+ return (FALSE);
+ }
}
else
{
num_chunks = TIFFNumberOfStrips(tif);
- TIFFGetField(tif, TIFFTAG_STRIPBYTECOUNTS, &bc);
+ if (!TIFFGetField(tif, TIFFTAG_STRIPBYTECOUNTS, &bc))
+ {
+ TIFFError(filename,
+ "Can't read bytecounts of strips at PS_Lvl2page()");
+ return (FALSE);
+ }
}

if (use_rawdata)
@@ -3107,7 +3117,11 @@ void PSRawDataBW(FILE *fd, TIFF *tif, uint32_t w, uint32_t h)
(void)w;
(void)h;
TIFFGetFieldDefaulted(tif, TIFFTAG_FILLORDER, &fillorder);
- TIFFGetField(tif, TIFFTAG_STRIPBYTECOUNTS, &bc);
+ if (!TIFFGetField(tif, TIFFTAG_STRIPBYTECOUNTS, &bc))
+ {
+ TIFFError(filename, "Can't read bytecounts of strips at PSRawDataBW()");
+ return;
+ }

/*
* Find largest strip:
--
2.45.4

6 changes: 5 additions & 1 deletion SPECS/libtiff/libtiff.spec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Summary: TIFF libraries and associated utilities.
Name: libtiff
Version: 4.6.0
Release: 6%{?dist}
Release: 7%{?dist}
License: libtiff
Vendor: Microsoft Corporation
Distribution: Azure Linux
Expand All @@ -13,6 +13,7 @@ Patch1: CVE-2023-6277.patch
Patch2: CVE-2024-7006.patch
Patch3: CVE-2023-3164.patch
Patch4: CVE-2023-6228.patch
Patch5: CVE-2025-8534.patch

BuildRequires: autoconf
BuildRequires: automake
Expand Down Expand Up @@ -66,6 +67,9 @@ make %{?_smp_mflags} -k check
%{_docdir}/*

%changelog
* Tue Aug 05 2025 Azure Linux Security Servicing Account <[email protected]> - 4.6.0-7
- Patch for CVE-2025-8534

* Mon Feb 03 2025 Ankita Pareek <[email protected]> - 4.6.0-6
- Address CVE-2023-6228 with a patch

Expand Down
Loading