Skip to content

Commit d92d957

Browse files
[Medium] Patch qtbase for CVE-2025-5455 (microsoft#14142)
1 parent e51cd7e commit d92d957

File tree

2 files changed

+54
-1
lines changed

2 files changed

+54
-1
lines changed

SPECS/qtbase/CVE-2025-5455.patch

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
From 25c4ed587ff4b16ea682721ffad16031bb91f03e Mon Sep 17 00:00:00 2001
2+
From: akhila-guruju <[email protected]>
3+
Date: Tue, 15 Jul 2025 06:19:38 +0000
4+
Subject: [PATCH] Address CVE-2025-5455
5+
6+
Upstream patch reference:
7+
1. https://download.qt.io/official_releases/qt/6.5/CVE-2025-5455-qtbase-6.5.patch
8+
2. for test: https://codereview.qt-project.org/c/qt/qtbase/+/642006/7/tests/auto/corelib/io/qdataurl/tst_qdataurl.cpp
9+
---
10+
src/corelib/io/qdataurl.cpp | 9 +++++----
11+
tests/auto/corelib/io/qdataurl/tst_qdataurl.cpp | 2 ++
12+
2 files changed, 7 insertions(+), 4 deletions(-)
13+
14+
diff --git a/src/corelib/io/qdataurl.cpp b/src/corelib/io/qdataurl.cpp
15+
index 92c6f541..9ace4e1f 100644
16+
--- a/src/corelib/io/qdataurl.cpp
17+
+++ b/src/corelib/io/qdataurl.cpp
18+
@@ -42,10 +42,11 @@ Q_CORE_EXPORT bool qDecodeDataUrl(const QUrl &uri, QString &mimeType, QByteArray
19+
}
20+
21+
if (QLatin1StringView{data}.startsWith("charset"_L1, Qt::CaseInsensitive)) {
22+
- qsizetype i = 7; // strlen("charset")
23+
- while (data.at(i) == ' ')
24+
- ++i;
25+
- if (data.at(i) == '=')
26+
+ qsizetype prefixSize = 7; // strlen("charset")
27+
+ QByteArrayView copy(data.constData() + prefixSize, data.size() - prefixSize);
28+
+ while (copy.startsWith(' '))
29+
+ copy = copy.sliced(1);
30+
+ if (copy.startsWith('='))
31+
data.prepend("text/plain;");
32+
}
33+
34+
diff --git a/tests/auto/corelib/io/qdataurl/tst_qdataurl.cpp b/tests/auto/corelib/io/qdataurl/tst_qdataurl.cpp
35+
index 8cc1b0ae..c1db6d59 100644
36+
--- a/tests/auto/corelib/io/qdataurl/tst_qdataurl.cpp
37+
+++ b/tests/auto/corelib/io/qdataurl/tst_qdataurl.cpp
38+
@@ -34,6 +34,8 @@ void tst_QDataUrl::decode_data()
39+
"text/plain"_L1, QByteArray::fromPercentEncoding("%E2%88%9A"));
40+
row("everythingIsCaseInsensitive", "Data:texT/PlaiN;charSet=iSo-8859-1;Base64,SGVsbG8=", true,
41+
"texT/PlaiN;charSet=iSo-8859-1"_L1, QByteArrayLiteral("Hello"));
42+
+ row("prematureCharsetEnd", "data:charset,", true,
43+
+ "charset", ""); // nonsense result, but don't crash
44+
}
45+
46+
void tst_QDataUrl::decode()
47+
--
48+
2.45.2
49+

SPECS/qtbase/qtbase.spec

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
Name: qtbase
3636
Summary: Qt6 - QtBase components
3737
Version: 6.6.3
38-
Release: 3%{?dist}
38+
Release: 4%{?dist}
3939
# See LICENSE.GPL3-EXCEPT.txt, for exception details
4040
License: GFDL AND LGPLv3 AND GPLv2 AND GPLv3 with exceptions AND QT License Agreement 4.0
4141
Vendor: Microsoft Corporation
@@ -98,6 +98,7 @@ Patch61: qtbase-cxxflag.patch
9898
# fix for new mariadb
9999
Patch65: qtbase-mysql.patch
100100
Patch66: CVE-2025-30348.patch
101+
Patch67: CVE-2025-5455.patch
101102

102103
# Do not check any files in %%{_qt_plugindir}/platformthemes/ for requires.
103104
# Those themes are there for platform integration. If the required libraries are
@@ -702,6 +703,9 @@ fi
702703
%{_qt_plugindir}/platformthemes/libqxdgdesktopportal.so
703704

704705
%changelog
706+
* Fri Jun 27 2025 Akhila Guruju <[email protected]> - 6.6.3-4
707+
- Patch CVE-2025-5455
708+
705709
* Wed Mar 26 2025 Jyoti Kanase <[email protected]> - 6.6.3-3
706710
- Fix CVE-2025-30348
707711

0 commit comments

Comments
 (0)