/

CVE-2026-78367

Severity:

HIGH RISK

(7.0)

Code Injection (CWE-94) in RPM rpmbuild Tarball Mode

CVE-2026-78367

Awaiting Analysis

Vulnerability type

Category:

Code Injection

CWE:

CWE-94

Impact:

Arbitrary Code Execution

Severity:

HIGH RISK

(7.0)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

A high-severity code injection vulnerability in RPM's rpmbuild tarball processing allows a crafted source archive member name to inject RPM macros, including Lua expressions.

When a victim or automated build system processes the archive in tarball mode, arbitrary code may execute with the privileges of the user running rpmbuild.

Affected context

The vulnerability occurs in RPM builds that process attacker-controlled source archives through rpmbuild tarball modes such as -ts, -ta, or -tb. It requires the archive to contain a specially crafted member name and for the build workflow to pass that name into macro expansion before the source package is fully trusted or constrained.

Exploit preconditions

  • Attack surface: RPM source tarball processing through rpmbuild
  • Required access: Ability to provide or influence a source archive processed by a victim or build system
  • Trigger point: Tarball member-name handling during getTarSpec() processing
  • Why exploitation is possible: An archive member name is incorporated into an RPM macro expression and evaluated by rpmExpand(), allowing attacker-controlled macro or Lua content to be interpreted

Why this happens

The underlying flaw is improper separation between archive metadata and executable macro language. The getTarSpec() function passes an attacker-controlled tar archive member name into rpmExpand() as part of a %{basename:...} expression, causing data that should remain a filename to be interpreted as RPM macro content.

This maps to CWE-94: Improper Control of Generation of Code ('Code Injection'), because untrusted input reaches an interpreter without adequate neutralization, validation, or isolation.

Potential impact

  • Arbitrary code may execute with the privileges of the rpmbuild process
  • Build hosts or automated CI workers could be compromised
  • Source packages, generated artifacts, or build outputs could be altered
  • Credentials and other data accessible to the build account could be exposed
  • Downstream software supply chains could be affected by tampered artifacts

General mitigation guidance

Mitigation generally focuses on preventing untrusted archive metadata from reaching executable macro evaluation.

Common defensive patterns include:

  • Treating archive member names as inert data rather than macro or script input
  • Applying strict validation and canonicalization to archive paths and metadata
  • Using narrowly scoped parsing APIs that do not evaluate embedded expressions
  • Separating source acquisition from privileged or sensitive build operations
  • Running builds with dedicated, least-privileged accounts and isolated workers
  • Reducing network, filesystem, and credential access available to build processes
  • Requiring provenance and policy checks before accepting externally supplied source archives

How teams detect issues like this

Detection approaches can include:

  • Static analysis searches for attacker-controlled archive metadata passed to macro, template, Lua, or shell evaluators
  • Code review checks for string interpolation into RPM expressions without strict validation
  • Regression tests using archive metadata containing unexpected delimiters or interpreter syntax
  • Build-policy enforcement that restricts externally supplied tarballs in privileged or connected workers
  • Runtime monitoring for unexpected child processes, file changes, or network activity from rpmbuild
  • Automated security review tools configured to flag interpreter-bound data flows

Sources

SourceLink
access.redhat.comaccess.redhat.com/errata/RHSA-2026:82378
access.redhat.comaccess.redhat.com/security/cve/CVE-2026-78367
bugzilla.redhat.combugzilla.redhat.com/show_bug.cgi?id=2521857
github.comgithub.com/rpm-software-management/rpm/issues/4314

Frequently asked

questions

It is not necessarily a network-service vulnerability. Exploitation can occur when a victim, CI system, or build service processes an attacker-controlled source tarball.

The attacker generally needs a way to supply or influence a source archive that will be processed by rpmbuild in tarball mode. Direct access to the build host is not inherently required.

Ensure archive member names remain data throughout processing, and prevent them from being evaluated as RPM macros, Lua, or other executable expressions.

Enforce strict archive metadata validation, isolate build workers, apply least privilege, and use code review or automated analysis to identify untrusted data flowing into interpreters.

Find out what's already
exploitable in your codebase.