public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/python3-rpm] epel8: CVE-2026-78367: Prevent command injection via rpmbuild -t
@ 2026-11-23 17:23 Michal Domonkos
0 siblings, 0 replies; only message in thread
From: Michal Domonkos @ 2026-11-23 17:23 UTC (permalink / raw)
To: git-commits
A new commit has been pushed.
Repo : rpms/python3-rpm
Branch : epel8
Commit : 3d36e9e84a82ee9d183f1048c402566a6cc380cc
Author : Michal Domonkos <mdomonko@redhat.com>
Date : 2026-10-15T13:45:18+02:00
Stats : +48/-1 in 2 file(s)
URL : https://src.fedoraproject.org/rpms/python3-rpm/c/3d36e9e84a82ee9d183f1048c402566a6cc380cc?branch=epel8
Log:
CVE-2026-78367: Prevent command injection via rpmbuild -t
Resolves: RHEL-247307
---
diff --git a/0001-Prevent-command-injection-via-rpmbuild-t.patch b/0001-Prevent-command-injection-via-rpmbuild-t.patch
new file mode 100644
index 0000000..eaaecb6
--- /dev/null
+++ b/0001-Prevent-command-injection-via-rpmbuild-t.patch
@@ -0,0 +1,43 @@
+From c186658501fc592cb35278d144e1a7a93c7ce5b7 Mon Sep 17 00:00:00 2001
+From: Michal Domonkos <mdomonko@redhat.com>
+Date: Wed, 26 Aug 2026 10:53:12 +0200
+Subject: [PATCH] Prevent command injection via rpmbuild -t
+
+When running in -t mode, the spec member name in the passed tarball will
+get macro-expanded twice: first when constructing the target filename in
+getTarSpec() and then in parseSpec(). This allows a crafted tarball to
+execute arbitrary code when the user just runs rpmbuild -ts or similar.
+
+Luckily, neither of these expansions is necessary, they are only done as
+a convenience and/or historical artifact. The former in getTarSpec() was
+only added recently via commit dfffedb5ebe46e039c0313b3d2fb939dfc63efd6
+and can easily be split into a basename(3) call so that the member name
+is not included in the expansion, effectively reverting that part of the
+original commit. The latter seems to be only used as a way to normalize
+the spec filename stored in the rpmSpec struct and can be replaced by a
+mere rpmCleanPath().
+
+Make both changes, and add a corresponding test, too.
+
+Fixes: CVE-2026-78367, #4314
+(backported from commit 2a11eb3e4e51094082e0123aebd797ec051dc094)
+---
+ build/parseSpec.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/build/parseSpec.c b/build/parseSpec.c
+index 51f7ee275..f842e1b54 100644
+--- a/build/parseSpec.c
++++ b/build/parseSpec.c
+@@ -763,7 +763,7 @@ static rpmSpec parseSpec(const char *specFile, rpmSpecFlags flags,
+ /* Set up a new Spec structure with no packages. */
+ spec = newSpec();
+
+- spec->specFile = rpmGetPath(specFile, NULL);
++ spec->specFile = rpmCleanPath(xstrdup(specFile));
+ pushOFI(spec, spec->specFile);
+ /* If buildRoot not specified, use default %{buildroot} */
+ if (buildRoot) {
+--
+2.56.0
+
diff --git a/rpm.spec b/rpm.spec
index 79d7b31..5066d5c 100644
--- a/rpm.spec
+++ b/rpm.spec
@@ -32,7 +32,7 @@
%global rpmver 4.14.3
#global snapver rc2
-%global rel 32
+%global rel 33
%global srcver %{version}%{?snapver:-%{snapver}}
%global srcdir %{?snapver:testing}%{!?snapver:%{name}-%(echo %{version} | cut -d'.' -f1-2).x}
@@ -146,6 +146,7 @@ Patch511: 0002-Fix-IMA-signature-fubar-take-III-1833-RhBug-2018937.patch
Patch512: 0003-Fix-root-relocation-regression.patch
Patch513: 0004-Report-unsafe-symlinks-during-installation-as-a-spec.patch
Patch514: 0005-Fix-FA_TOUCH-ed-files-getting-removed-on-failed-upda.patch
+Patch515: 0001-Prevent-command-injection-via-rpmbuild-t.patch
# These are not yet upstream
# Audit support
@@ -716,6 +717,9 @@ make check || cat tests/rpmtests.log
%doc doc/librpm/html/*
%changelog
+* Thu Oct 15 2026 Michal Domonkos <mdomonko@redhat.com> - 4.14.3-33
+- CVE-2026-78367: Prevent command injection via rpmbuild -t (RHEL-247307)
+
* Mon Oct 21 2024 Michal Domonkos <mdomonko@redhat.com> - 4.14.3-32
- Fix FA_TOUCH'ed files getting removed on failed update (RHEL-63069)
- Fix IMA signature lengths assumed constant (RHEL-39896)
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-11-23 17:23 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-23 17:23 [rpms/python3-rpm] epel8: CVE-2026-78367: Prevent command injection via rpmbuild -t Michal Domonkos
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox