Skip to content

Commit b6476f7

Browse files
[Medium] Patch qt5-qtbase for CVE-2025-5455 (microsoft#14190)
1 parent 24dea93 commit b6476f7

File tree

2 files changed

+72
-1
lines changed

2 files changed

+72
-1
lines changed
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
From 3e55c2a5d82093c2dddb7bcf61f431ad666f5103 Mon Sep 17 00:00:00 2001
2+
From: akhila-guruju <[email protected]>
3+
Date: Wed, 9 Jul 2025 13:04:18 +0000
4+
Subject: [PATCH] Address CVE-2025-5455
5+
6+
Upstream Patch Reference:
7+
1. https://www.qt.io/blog/security-advisory-recently-discovered-issue-in-qdecodedataurl-in-qtcore-impacts-qt (v5.15) - https://download.qt.io/official_releases/qt/5.15/CVE-2025-5455-qtbase-5.15.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+
---
11+
src/corelib/io/qdataurl.cpp | 9 +++++----
12+
tests/auto/corelib/io/qdataurl/tst_qdataurl.cpp | 13 +++++++++++++
13+
2 files changed, 18 insertions(+), 4 deletions(-)
14+
15+
diff --git a/src/corelib/io/qdataurl.cpp b/src/corelib/io/qdataurl.cpp
16+
index 9cb1b9ab..707bc358 100644
17+
--- a/src/corelib/io/qdataurl.cpp
18+
+++ b/src/corelib/io/qdataurl.cpp
19+
@@ -76,10 +76,11 @@ Q_CORE_EXPORT bool qDecodeDataUrl(const QUrl &uri, QString &mimeType, QByteArray
20+
}
21+
22+
if (data.toLower().startsWith("charset")) {
23+
- int i = 7; // strlen("charset")
24+
- while (data.at(i) == ' ')
25+
- ++i;
26+
- if (data.at(i) == '=')
27+
+ int prefixSize = 7; // strlen("charset")
28+
+ QLatin1String copy(data.constData() + prefixSize, data.size() - prefixSize);
29+
+ while (copy.startsWith(QLatin1String(" ")))
30+
+ copy = copy.mid(1);
31+
+ if (copy.startsWith(QLatin1String("=")))
32+
data.prepend("text/plain;");
33+
}
34+
35+
diff --git a/tests/auto/corelib/io/qdataurl/tst_qdataurl.cpp b/tests/auto/corelib/io/qdataurl/tst_qdataurl.cpp
36+
index 66720d28..a236a0dc 100644
37+
--- a/tests/auto/corelib/io/qdataurl/tst_qdataurl.cpp
38+
+++ b/tests/auto/corelib/io/qdataurl/tst_qdataurl.cpp
39+
@@ -38,6 +38,7 @@ private slots:
40+
void nonData();
41+
void emptyData();
42+
void alreadyPercentageEncoded();
43+
+ void prematureCharsetEnd();
44+
};
45+
46+
void tst_QDataUrl::nonData()
47+
@@ -74,5 +75,17 @@ void tst_QDataUrl::alreadyPercentageEncoded()
48+
QCOMPARE(payload, QByteArray::fromPercentEncoding("%E2%88%9A"));
49+
}
50+
51+
+void tst_QDataUrl::prematureCharsetEnd()
52+
+{
53+
+ QLatin1String data("data:charset,");
54+
+ QUrl url(data);
55+
+ QString mimeType;
56+
+ QByteArray payload;
57+
+ bool result = qDecodeDataUrl(url, mimeType, payload);
58+
+ QVERIFY(result);
59+
+ QCOMPARE(mimeType, QLatin1String("charset"));
60+
+ QVERIFY(payload.isEmpty());
61+
+}
62+
+
63+
QTEST_MAIN(tst_QDataUrl)
64+
#include "tst_qdataurl.moc"
65+
--
66+
2.45.2
67+

SPECS/qt5-qtbase/qt5-qtbase.spec

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
Name: qt5-qtbase
3434
Summary: Qt5 - QtBase components
3535
Version: 5.12.11
36-
Release: 16%{?dist}
36+
Release: 17%{?dist}
3737
# See LICENSE.GPL3-EXCEPT.txt, for exception details
3838
License: GFDL AND LGPLv3 AND GPLv2 AND GPLv3 with exceptions AND QT License Agreement 4.0
3939
Vendor: Microsoft Corporation
@@ -168,6 +168,7 @@ Patch93: CVE-2022-25255.patch
168168
Patch94: CVE-2024-25580.patch
169169
Patch95: CVE-2023-34410.patch
170170
Patch96: CVE-2025-30348.patch
171+
Patch97: CVE-2025-5455.patch
171172

172173
# Do not check any files in %%{_qt5_plugindir}/platformthemes/ for requires.
173174
# Those themes are there for platform integration. If the required libraries are
@@ -777,6 +778,9 @@ fi
777778
%{_qt5_libdir}/cmake/Qt5Gui/Qt5Gui_QXdgDesktopPortalThemePlugin.cmake
778779

779780
%changelog
781+
* Tue Jul 01 2025 Akhila Guruju <[email protected]> - 5.12.11-17
782+
- Patch CVE-2025-5455
783+
780784
* Fri Jun 13 2025 Jyoti Kanase <[email protected]> - 5.12.11-16
781785
- Fix CVE-2025-30348
782786

0 commit comments

Comments
 (0)