From 05d0b6cbfbaec20d42cabdccf5a625631c22ffae Mon Sep 17 00:00:00 2001 From: Funda Wang Date: Thu, 16 Oct 2025 10:36:00 +0800 Subject: [PATCH] fix CVE-2025-5683 (cherry picked from commit f310bfd50ef54042513e6fce24323a79a1a27e80) --- CVE-2025-5683.patch | 27 +++++++++++++++++++++++++++ qt5-qtimageformats.spec | 7 ++++++- 2 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 CVE-2025-5683.patch diff --git a/CVE-2025-5683.patch b/CVE-2025-5683.patch new file mode 100644 index 0000000..9e01bcf --- /dev/null +++ b/CVE-2025-5683.patch @@ -0,0 +1,27 @@ +diff --git a/src/plugins/imageformats/icns/qicnshandler.cpp b/src/plugins/imageformats/icns/qicnshandler.cpp +index 02086cbf26c..207f7cd8393 100644 +--- a/src/plugins/imageformats/icns/qicnshandler.cpp ++++ b/src/plugins/imageformats/icns/qicnshandler.cpp +@@ -359,8 +359,11 @@ + + static inline bool isBlockHeaderValid(const ICNSBlockHeader &header, quint64 bound = 0) + { +- return header.ostype != 0 && (bound == 0 +- || qBound(quint64(ICNSBlockHeaderSize), quint64(header.length), bound) == header.length); ++ return header.ostype != 0 && ++ (bound == 0 || ++ // qBound can be used but requires checking the limits first ++ // this requires less operations ++ (ICNSBlockHeaderSize <= header.length && header.length <= bound)); + } + + static inline bool isIconCompressed(const ICNSEntry &icon) +@@ -892,7 +895,7 @@ + return false; + + const qint64 blockDataOffset = device()->pos(); +- if (!isBlockHeaderValid(blockHeader)) { ++ if (!isBlockHeaderValid(blockHeader, ICNSBlockHeaderSize - blockDataOffset + filelength)) { + qWarning("QICNSHandler::scanDevice(): Failed, bad header at pos %s. OSType \"%s\", length %u", + QByteArray::number(blockDataOffset).constData(), + nameFromOSType(blockHeader.ostype).constData(), blockHeader.length); diff --git a/qt5-qtimageformats.spec b/qt5-qtimageformats.spec index a93cdca..f8c839c 100644 --- a/qt5-qtimageformats.spec +++ b/qt5-qtimageformats.spec @@ -2,12 +2,14 @@ Name: qt5-qtimageformats Version: 5.15.2 -Release: 1 +Release: 2 Summary: Qtimageformats component of qt5 License: LGPLv2 with exceptions or GPLv3 with exceptions Url: http://www.qt.io %global majmin %(echo %{version} | cut -d. -f1-2) Source0: https://download.qt.io/official_releases/qt/%{majmin}/%{version}/submodules/qtimageformats-everywhere-src-%{version}.tar.xz +# https://download.qt.io/official_releases/qt/6.5/CVE-2025-5683-qtimageformats-6.5.patch +Patch0: CVE-2025-5683.patch BuildRequires: make BuildRequires: qt5-qtbase-devel >= %{version} libmng-devel libtiff-devel libwebp-devel @@ -40,6 +42,9 @@ make install INSTALL_ROOT=%{buildroot} %{_qt5_libdir}/cmake/Qt5Gui/Qt5Gui_*Plugin.cmake %changelog +* Thu Oct 16 2025 Funda Wang - 5.15.2-2 +- fix CVE-2025-5683 + * Wed Oct 13 2021 peijiankang - 5.15.2-1 - update to upstream version 5.15.2 -- Gitee