/

CVE-2026-86320

Severity:

HIGH RISK

(7.8)

Code Injection (CWE-94) in flatpak-builder Git Hooks

CVE-2026-86320

Awaiting Analysis

Vulnerability type

Category:

Code Injection

CWE:

CWE-94

Impact:

Arbitrary Code Execution

Severity:

HIGH RISK

(7.8)

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

flatpak-builder may execute a Git hook from a patch source when the use-git-am option is enabled and hooks are not disabled during patch application. An attacker who can supply or influence such a source may achieve arbitrary code execution on the host with the privileges of the user running the build.

Affected context

The vulnerability can occur in build environments that use flatpak-builder to apply Git-formatted patch sources with use-git-am enabled. It requires a source under attacker influence to contain a Git hook and for the build process to apply that source without disabling or otherwise isolating hook execution.

Exploit preconditions

  • Attack surface: The flatpak-builder source-processing and patch-application workflow
  • Required access: Ability to provide, modify, or cause the build to consume a malicious patch source
  • Trigger point: Application of the Git-formatted patch source during the build
  • Why exploitation is possible: Git hooks are not disabled before the patch is applied, allowing hook code supplied through the source to execute in the build environment

Why this happens

The underlying bug is insufficient control over executable behavior in attacker-influenced Git content. When patch sources are applied with use-git-am enabled, Git hook execution remains available instead of being explicitly disabled or restricted. This maps to CWE-94, Code Injection, because data supplied as part of a source is interpreted as executable logic during a privileged build operation.

Potential impact

  • Arbitrary code may execute on the host running flatpak-builder
  • Build credentials, source code, or local configuration could be exposed
  • Generated artifacts could be modified or poisoned
  • The attacker could gain the privileges available to the build user
  • Compromise could extend to other systems reachable from the build environment

General mitigation guidance

Mitigation generally focuses on preventing untrusted Git content from

triggering executable hooks during source preparation.

Common defensive patterns include:

  • Disabling Git hooks by default whenever patch sources are applied
  • Using restricted source-processing workflows that treat repository metadata as untrusted
  • Separating source acquisition from build execution
  • Running builds with dedicated, least-privileged identities and isolated workspaces
  • Limiting filesystem, network, credential, and IPC access available to build processes
  • Applying policy controls that reject sources containing executable repository hooks
  • Keeping build inputs immutable and subject to provenance and integrity checks

How teams detect issues like this

Organizations can look for this class of issue through:

  • Static analysis and code review checks for patch-application paths that leave Git hooks enabled
  • Tests using untrusted repositories or patch sources containing hook metadata
  • Build-policy checks that prohibit executable hooks in fetched or generated inputs
  • Runtime monitoring for unexpected child processes launched by flatpak-builder or its build helpers
  • Audit records that correlate source acquisition, patch application, and process execution
  • Automated security review tools that flag execution of repository-controlled behavior in build pipelines

Sources

SourceLink
access.redhat.comaccess.redhat.com/errata/RHSA-2026:80495
access.redhat.comaccess.redhat.com/errata/RHSA-2026:80496
access.redhat.comaccess.redhat.com/errata/RHSA-2026:80973
access.redhat.comaccess.redhat.com/errata/RHSA-2026:84832
access.redhat.comaccess.redhat.com/errata/RHSA-2026:84833
access.redhat.comaccess.redhat.com/errata/RHSA-2026:84834
access.redhat.comaccess.redhat.com/errata/RHSA-2026:84842
access.redhat.comaccess.redhat.com/errata/RHSA-2026:86714
access.redhat.comaccess.redhat.com/errata/RHSA-2026:90896
access.redhat.comaccess.redhat.com/errata/RHSA-2026:92220
access.redhat.comaccess.redhat.com/security/cve/CVE-2026-86320
bugzilla.redhat.combugzilla.redhat.com/show_bug.cgi?id=2471023
github.comgithub.com/flatpak/flatpak-builder/security/advisories/GHSA-j5p8-jgjc-f3xv

Frequently asked

questions

It is not necessarily network-reachable by itself. Exploitation may occur when a

build system consumes a malicious source supplied through a remote repository,

package workflow, or other attacker-influenced input.

The attacker generally needs the ability to provide, modify, or influence a

patch source that flatpak-builder will process with use-git-am enabled. Direct

access to the build host is not inherently required if the source is accepted

through an external workflow.

Git hooks should be disabled or otherwise blocked when applying untrusted patch

sources, and source-processing operations should not execute repository-controlled

behavior by default.

Treat all fetched source metadata as untrusted, enforce build isolation and

least privilege, validate source provenance, and add CI tests and policy checks

that detect executable hooks in build inputs.

Find out what's already
exploitable in your codebase.