[AutoPR- Security] Patch kf-kcoreaddons for CVE-2026-41526 [MEDIUM]#16992
Merged
kgodara912 merged 2 commits intomicrosoft:3.0-devfrom May 8, 2026
Merged
Conversation
Contributor
Contributor
|
Buddy Build is successful. |
Contributor
Author
🔒 CVE Patch Review: CVE-2026-41526PR #16992 — [AutoPR- Security] Patch kf-kcoreaddons for CVE-2026-41526 [MEDIUM] Spec File Validation
Build Verification
🤖 AI Build Log Analysis
🧪 Test Log Analysis
🤖 AI Test Log Analysis
Patch Analysis
Detailed analysisCore fix equivalence:
Tests:
Scope and completeness:
Risk assessment:
Context line differences:
Raw diff (upstream vs PR)--- upstream
+++ pr
@@ -1,71 +1,80 @@
-From 6153c9ae025fa570174bb4a143df38fa2f46606b Mon Sep 17 00:00:00 2001
-From: Tobias Fella <tobias.fella@kde.org>
-Date: Wed, 8 Apr 2026 16:08:02 +0200
-Subject: [PATCH] Remove control characters when quoting args Using these
- characters can lead to unexpected results.
-
----
- autotests/kshelltest.cpp | 10 +++++++++-
- src/lib/util/kshell_unix.cpp | 15 ++++++++++-----
- 2 files changed, 19 insertions(+), 6 deletions(-)
-
-diff --git a/autotests/kshelltest.cpp b/autotests/kshelltest.cpp
-index 09dbe3f0..5a4f4709 100644
---- a/autotests/kshelltest.cpp
-+++ b/autotests/kshelltest.cpp
-@@ -79,6 +79,14 @@ void KShellTest::quoteArg()
- QCOMPARE(KShell::quoteArg(QStringLiteral("a % space")), QStringLiteral("\"a %PERCENT_SIGN% space\""));
- #else
- QCOMPARE(KShell::quoteArg(QStringLiteral("a space")), QStringLiteral("'a space'"));
-+ QCOMPARE(KShell::quoteArg(QStringLiteral("a\x01")), QStringLiteral("a"));
-+ QCOMPARE(KShell::quoteArg(QStringLiteral("\x01")), QStringLiteral("''"));
-+ QCOMPARE(KShell::quoteArg(QStringLiteral("a\x02")), QStringLiteral("a"));
-+ QCOMPARE(KShell::quoteArg(QStringLiteral("a\x7f")), QStringLiteral("a"));
-+ QCOMPARE(KShell::quoteArg(QStringLiteral("🫠")), QStringLiteral("🫠"));
-+ QCOMPARE(KShell::quoteArg(QStringLiteral("👩👩👧👦")), QStringLiteral("👩👩👧👦"));
-+ QCOMPARE(KShell::quoteArg(QStringLiteral("ひらがな")), QStringLiteral("ひらがな"));
-+ QCOMPARE(KShell::quoteArg(QStringLiteral("ひらがな\x1")), QStringLiteral("ひらがな"));
- #endif
- }
-
-@@ -124,7 +132,7 @@ void KShellTest::splitJoin()
- QCOMPARE(err, KShell::NoError);
- #else
- QCOMPARE(sj(QString::fromUtf8("\"~qU4rK\" 'text' 'jo'\"jo\" $'crap' $'\\\\\\'\\e\\x21' ha\\ lo \\a"), KShell::NoOptions, &err),
-- QString::fromUtf8("'~qU4rK' text jojo crap '\\'\\''\x1b!' 'ha lo' a"));
-+ QString::fromUtf8("'~qU4rK' text jojo crap '\\'\\''!' 'ha lo' a"));
- QCOMPARE(err, KShell::NoError);
-
- QCOMPARE(sj(QStringLiteral("\"~qU4rK\" 'text'"), KShell::TildeExpand, &err), QStringLiteral("'~qU4rK' text"));
-diff --git a/src/lib/util/kshell_unix.cpp b/src/lib/util/kshell_unix.cpp
-index e87afc8c..61c0aad4 100644
---- a/src/lib/util/kshell_unix.cpp
-+++ b/src/lib/util/kshell_unix.cpp
-@@ -294,14 +294,19 @@ inline static bool isSpecial(QChar cUnicode)
-
- QString KShell::quoteArg(const QString &arg)
- {
-- if (arg.isEmpty()) {
-+ auto quoted = arg;
-+ quoted.removeIf([](const QChar &input) {
-+ return input.category() == QChar::Other_Control;
-+ });
-+ if (quoted.isEmpty()) {
- return QStringLiteral("''");
- }
-- for (int i = 0; i < arg.length(); i++) {
-- if (isSpecial(arg.unicode()[i])) {
+diff --git a/SPECS/kf-kcoreaddons/CVE-2026-41526.patch b/SPECS/kf-kcoreaddons/CVE-2026-41526.patch
+new file mode 100644
+index 00000000000..f6a3e31daeb
+--- /dev/null
++++ b/SPECS/kf-kcoreaddons/CVE-2026-41526.patch
+@@ -0,0 +1,74 @@
++From 33523981f61acf8e2a389f90031c6524576a18d9 Mon Sep 17 00:00:00 2001
++From: AllSpark <allspark@microsoft.com>
++Date: Fri, 1 May 2026 17:09:03 +0000
++Subject: [PATCH] Remove control characters when quoting args
+
-+ for (int i = 0; i < quoted.length(); i++) {
-+ if (isSpecial(quoted.unicode()[i])) {
- QChar q(QLatin1Char('\''));
-- return q + QString(arg).replace(q, QLatin1String("'\\''")) + q;
-+ return q + QString(quoted).replace(q, QLatin1String("'\\''")) + q;
- }
- }
-- return arg;
-+ return quoted;
- }
---
-GitLab
-
++Using these characters can lead to unexpected results.
++
++Signed-off-by: Azure Linux Security Servicing Account <azurelinux-security@microsoft.com>
++Upstream-reference: AI Backport of https://invent.kde.org/frameworks/kcoreaddons/-/commit/6153c9ae025fa570174bb4a143df38fa2f46606b.patch
++---
++ autotests/kshelltest.cpp | 10 +++++++++-
++ src/lib/util/kshell_unix.cpp | 15 ++++++++++-----
++ 2 files changed, 19 insertions(+), 6 deletions(-)
++
++diff --git a/autotests/kshelltest.cpp b/autotests/kshelltest.cpp
++index e08bb91..afed14d 100644
++--- a/autotests/kshelltest.cpp
+++++ b/autotests/kshelltest.cpp
++@@ -78,6 +78,14 @@ void KShellTest::quoteArg()
++ QCOMPARE(KShell::quoteArg(QStringLiteral("a % space")), QStringLiteral("\"a %PERCENT_SIGN% space\""));
++ #else
++ QCOMPARE(KShell::quoteArg(QStringLiteral("a space")), QStringLiteral("'a space'"));
+++ QCOMPARE(KShell::quoteArg(QStringLiteral("a\x01")), QStringLiteral("a"));
+++ QCOMPARE(KShell::quoteArg(QStringLiteral("\x01")), QStringLiteral("''"));
+++ QCOMPARE(KShell::quoteArg(QStringLiteral("a\x02")), QStringLiteral("a"));
+++ QCOMPARE(KShell::quoteArg(QStringLiteral("a\x7f")), QStringLiteral("a"));
+++ QCOMPARE(KShell::quoteArg(QStringLiteral("🫠")), QStringLiteral("🫠"));
+++ QCOMPARE(KShell::quoteArg(QStringLiteral("👩👩👧👦")), QStringLiteral("👩👩👧👦"));
+++ QCOMPARE(KShell::quoteArg(QStringLiteral("ひらがな")), QStringLiteral("ひらがな"));
+++ QCOMPARE(KShell::quoteArg(QStringLiteral("ひらがな\x1")), QStringLiteral("ひらがな"));
++ #endif
++ }
++
++@@ -123,7 +131,7 @@ void KShellTest::splitJoin()
++ QVERIFY(err == KShell::NoError);
++ #else
++ QCOMPARE(sj(QString::fromUtf8("\"~qU4rK\" 'text' 'jo'\"jo\" $'crap' $'\\\\\\'\\e\\x21' ha\\ lo \\a"), KShell::NoOptions, &err),
++- QString::fromUtf8("'~qU4rK' text jojo crap '\\'\\''\x1b!' 'ha lo' a"));
+++ QString::fromUtf8("'~qU4rK' text jojo crap '\\'\\''!' 'ha lo' a"));
++ QVERIFY(err == KShell::NoError);
++
++ QCOMPARE(sj(QStringLiteral("\"~qU4rK\" 'text'"), KShell::TildeExpand, &err), QStringLiteral("'~qU4rK' text"));
++diff --git a/src/lib/util/kshell_unix.cpp b/src/lib/util/kshell_unix.cpp
++index 616c7c1..61c0aad 100644
++--- a/src/lib/util/kshell_unix.cpp
+++++ b/src/lib/util/kshell_unix.cpp
++@@ -294,14 +294,19 @@ inline static bool isSpecial(QChar cUnicode)
++
++ QString KShell::quoteArg(const QString &arg)
++ {
++- if (!arg.length()) {
+++ auto quoted = arg;
+++ quoted.removeIf([](const QChar &input) {
+++ return input.category() == QChar::Other_Control;
+++ });
+++ if (quoted.isEmpty()) {
++ return QStringLiteral("''");
++ }
++- for (int i = 0; i < arg.length(); i++) {
++- if (isSpecial(arg.unicode()[i])) {
+++
+++ for (int i = 0; i < quoted.length(); i++) {
+++ if (isSpecial(quoted.unicode()[i])) {
++ QChar q(QLatin1Char('\''));
++- return q + QString(arg).replace(q, QLatin1String("'\\''")) + q;
+++ return q + QString(quoted).replace(q, QLatin1String("'\\''")) + q;
++ }
++ }
++- return arg;
+++ return quoted;
++ }
++--
++2.45.4
++
Verdict❌ CHANGES REQUESTED — Please address the issues flagged above. |
Kanishk-Bansal
approved these changes
May 6, 2026
Contributor
Kanishk-Bansal
left a comment
There was a problem hiding this comment.
Patch Analysis (Patch Matches Upstream)
AI test analysis fix is not needed
- Buddy Build
- patch applied during the build (check
rpm.log) - patch include an upstream reference
- PR has security tag
kgodara912
approved these changes
May 8, 2026
Contributor
kgodara912
left a comment
There was a problem hiding this comment.
Patch matches with upstream reference except one removed line. Buddy build is successful. LGTM.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Auto Patch kf-kcoreaddons for CVE-2026-41526.
Autosec pipeline run -> https://dev.azure.com/mariner-org/mariner/_build/results?buildId=1107272&view=results
Merge Checklist
All boxes should be checked before merging the PR (just tick any boxes which don't apply to this PR)
*-staticsubpackages, etc.) have had theirReleasetag incremented../cgmanifest.json,./toolkit/scripts/toolchain/cgmanifest.json,.github/workflows/cgmanifest.json)./LICENSES-AND-NOTICES/SPECS/data/licenses.json,./LICENSES-AND-NOTICES/SPECS/LICENSES-MAP.md,./LICENSES-AND-NOTICES/SPECS/LICENSE-EXCEPTIONS.PHOTON)*.signatures.jsonfilessudo make go-tidy-allandsudo make go-test-coveragepassSummary
What does the PR accomplish, why was it needed?
Change Log
Does this affect the toolchain?
YES/NO
Associated issues
Links to CVEs
Test Methodology