CVE-2026-78367: Rpm: rpmbuild gettarspec() crafted tar member name → macro injection

Published Aug 24, 2026
·
Updated

A flaw was found in rpmbuild. When rpmbuild processes a crafted tarball in tarball mode, a specially designed tar member name can lead to macro injection. This vulnerability allows a remote attacker to execute arbitrary code on the system by convincing a user to build a malicious tarball.

Other sources

When rpmbuild runs in tarball mode (-ta / -tb / -ts, etc.), getTarSpec() extracts a .spec from the archive and renames it using the member name from tar’s verbose listing. That member name is concatenated into:

specFinal = rpmExpand("%{specdir}/%{basename:", tarbuf, "}", NULL);

A crafted .spec member name containing } closes %{basename:...} early. Text after the } is expanded as further RPM macros, including %{lua:} (full Lua stdlib, rpm.execute / rpm.spawn). The expanded string is used as the destination of rename() and as the spec path for the rest of the build.

This happens while locating the spec — before %prep. It is not “spec scripts run shell by design.” The victim only needs to run rpmbuild -ts (or -ta / -tb) on a crafted tarball.

This is a sibling / variant of CVE-2026-44604: untrusted archive metadata (here: tar member name; there: ZIP/7z/GEM top-level directory) is interpolated into a privileged expand/popen path. Different call site (getTarSpec vs rpmuncompress), same trust-boundary class. CVE-2026-44604 did not fix this path.

Red Hat

Affected Software

1 affected component
RPM rpmbuild

Event History

Aug 24, 2026
Data Sourced
via Red Hat·01:09 PM
DescriptionSeverityAffected Software
CVE Published
via MITRE·01:48 PM
Data Sourced
via MITRE·01:48 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·02:17 PM
DescriptionSeverityWeakness

Frequently Asked Questions

1

Who is exposed to this issue?

Users or build systems that run rpmbuild in tarball mode on untrusted tarballs are exposed. Exploitation requires the victim to invoke rpmbuild with options such as -ts, -ta, or -tb on an attacker-crafted archive.

2

Does the malicious archive need to contain build scripts that are executed?

No. The injection occurs while rpmbuild is locating and renaming the extracted spec file, before the %prep stage. A crafted tar member name can cause additional RPM macros to expand, including Lua macros capable of executing code.

3

What archive content is used for the injection?

The relevant input is the tar member name of the .spec file, as obtained from tar’s verbose listing. A } in that member name can terminate the intended %{basename:...} expansion and cause following text to be interpreted as RPM macros.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203