Skip to main content
COSMICBYTEZ LABS
NewsSecurityHOWTOsTools
ProjectsNewsletterHire MeAbout
Subscribe

Press Enter to search or Esc to close

News
Security
HOWTOs
Tools
Projects
Newsletter
Hire Me
About
RSS Feed
Reading List
Subscribe

Stay in the Loop

Get the latest security alerts, tutorials, and tech insights delivered to your inbox.

Subscribe NowFree forever. No spam.
COSMICBYTEZLABS

Your trusted source for IT intelligence, cybersecurity insights, and hands-on technical guides.

3,036+ Articles
170+ Guides

CONTENT

  • Latest News
  • Security Alerts
  • HOWTOs
  • Tools
  • Checklists
  • Projects

RESOURCES

  • Search
  • Browse Tags
  • Newsletter Archive
  • Reading List
  • RSS Feed

COMPANY

  • Hire Me
  • About Us
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CosmicBytez Labs. All rights reserved.

  1. Home
  2. Security
  3. CVE-2026-96276: Flatpak build-init Path Traversal Enables Arbitrary File Writes
SECURITYCRITICALCVE-2026-96276

CVE-2026-96276: Flatpak build-init Path Traversal Enables Arbitrary File Writes

A malicious Flatpak SDK extension can abuse build-init path resolution to write attacker files outside the build tree.

Dylan H.

Security Team

September 24, 2026
8 min read
CVE-2026-96276: Flatpak build-init Path Traversal Enables Arbitrary File Writes

Critical severity

Rated critical. Prioritise patching — see the remediation guidance below.

Affected Products

  • Flatpak through 1.18.0 (mainline branch, exact earliest affected version not specified in public advisories)
  • flatpak-1.16.x LTS branch prior to its backported fix

Executive Summary

CVE-2026-96276 is a path traversal vulnerability (CWE-22) in Flatpak, the Linux application sandboxing and distribution framework, carrying a CVSS score of 9.8 (Critical) per NVD and Red Hat's scoring. It was published 2026-09-23 and affects the flatpak build-init command when invoked with SDK extension handling.

flatpak build-init --writable-sdk --sdk-extension is a normal part of the Flatpak build workflow: it sets up a writable build sandbox and copies files from a named SDK extension into that sandbox so a developer can build against it. The problem is in how the target location for those copied files is computed. Extension points can declare a directory key in their metadata telling Flatpak where inside the build tree to place the extension's files. In vulnerable versions, that path is resolved with g_file_resolve_relative_path, a GLib function that happily resolves .. components. A malicious or compromised SDK container can therefore declare an extension point with a directory value such as ../../some/host/path, and when a developer runs build-init against that SDK, Flatpak writes the attacker's files at that resolved — and unintended — location instead of confining them to the build directory.

It gets worse before it gets better: Flatpak cleans the destination path with flatpak_rm_rf before copying the extension's content into it. That means the traversal doesn't just add attacker-controlled files somewhere unexpected — it first deletes whatever already exists at the traversed path, then replaces it with attacker-supplied content. On a developer workstation or CI build agent, that combination (delete-then-write, attacker-controlled destination) is a path to configuration tampering, dotfile/profile poisoning, or planting executable content somewhere it will later run.

The fix (Flatpak 1.18.1, with a backport for the flatpak-1.16.x LTS branch) reworks the copy path to use fd-relative operations that cannot escape the intended directory, rather than resolving a string path that can contain .. segments.


Vulnerability Overview

FieldValue
CVE IDCVE-2026-96276
CVSS Score9.8 (Critical) — per NVD/Red Hat scoring (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H). Note: the upstream GitHub Security Advisory for this same issue (GHSA-8qxj-x646-phcm) rates it "Moderate" — the two sources disagree on real-world severity, and this article follows the NVD/Red Hat Critical rating per the confirmed tracker facts.
TypePath Traversal → Arbitrary File Write (and pre-write deletion via flatpak_rm_rf)
CWECWE-22: Improper Limitation of a Pathname to a Restricted Directory ("Path Traversal")
Attack VectorLocal build-time operation (CVSS vector marks it Network, reflecting that the malicious content originates from a remote SDK source)
Privileges RequiredNone
User InteractionNone per the CVSS vector, but exploitation requires a developer to actively run flatpak build-init against the malicious SDK — see Condition below
ConditionA developer (or CI job) must run flatpak build-init --writable-sdk --sdk-extension (or --base-extensions) against an attacker-controlled or compromised SDK container that declares a crafted extension-point directory path

Affected Versions

ComponentAffected VersionsFixed Version
Flatpak (mainline)Versions through 1.18.0 (public advisories reviewed do not state the exact earliest affected release — treat any pre-1.18.1 mainline build as unverified/potentially vulnerable until confirmed otherwise)1.18.1
Flatpak (LTS branch)flatpak-1.16.x prior to the backported fixBackported fix on the flatpak-1.16.x branch (requires the accompanying libglnx changes — see Immediate Remediation)

We could not verify an exact affected-version floor (e.g., "1.x and later") from NVD, the GitHub advisory, or Red Hat's bug tracker as of this writing. Treat "any version older than 1.18.1, or the flatpak-1.16.x branch prior to its patch commits" as the safe working assumption.


Attack Vector

1. Attacker publishes or compromises a Flatpak SDK container (e.g. a
   community/unofficial SDK remote, or a legitimate SDK repo that has
   been tampered with).
 
2. The malicious SDK declares an extension point in its metadata whose
   "directory" key is set to a traversal path instead of a normal
   in-tree relative path — for example, something equivalent to
   "../../.config/some-target" rather than "files/target".
 
3. A developer (or a CI/build pipeline) adds that SDK as a remote and
   runs:
       flatpak build-init --writable-sdk --sdk-extension=org.example.MaliciousSdk ...
   (or the equivalent --base-extensions invocation) to set up a build
   sandbox against it.
 
4. build-init resolves the extension point's "directory" value with
   g_file_resolve_relative_path, which honors ".." segments instead of
   confining the result to the build tree.
 
5. Before copying the extension's files in, Flatpak cleans the
   resolved destination with flatpak_rm_rf — deleting whatever already
   exists there.
 
6. Flatpak then copies the extension's attacker-controlled files into
   that resolved path, which now sits OUTSIDE the intended build
   working directory, potentially overwriting developer config,
   dotfiles, shell profile fragments, or other host-side files reachable
   by the resolved path.
 
7. Depending on what was overwritten, the attacker gains a foothold for
   code execution on the next shell/login, persistence on the
   developer's workstation, or corruption of files a CI build agent
   depends on for subsequent steps.

Impact of Successful Exploitation

Impact AreaDescription
Developer workstation compromiseAttacker-controlled files written (and prior files deleted) outside the sandboxed build directory, on the developer's own filesystem
CI/CD build-pipeline compromiseAn automated pipeline that runs build-init against an untrusted or misconfigured SDK remote can have its build agent's filesystem tampered with, potentially affecting later pipeline steps or artifacts
Data lossflatpak_rm_rf removes existing content at the traversed path before writing — meaning legitimate files can be destroyed even before the attacker's replacement content lands
Supply-chain poisoningIf the affected host is later used to build and publish Flatpak packages, a compromised build environment could propagate tampering into distributed application artifacts

Immediate Remediation

Update Flatpak to the fixed version

On most distributions, Flatpak itself is a system package, not something updated through the Flatpak/Flathub application layer:

# Debian/Ubuntu
sudo apt update && sudo apt install --only-upgrade flatpak
 
# Fedora / RHEL / CentOS Stream
sudo dnf upgrade flatpak
 
# Arch Linux
sudo pacman -Syu flatpak
 
# Confirm the installed version
flatpak --version

Confirm the installed version is 1.18.1 or later on the mainline branch, or that your distribution has applied the flatpak-1.16.x LTS backport (which also requires the accompanying libglnx glnx_chaseat_full / glnx_chase_and_mkdirat changes — check your distribution's changelog or package advisory rather than assuming a point release alone is sufficient).

Verify only trusted SDKs and remotes are in use

  • Audit flatpak remotes on every workstation and CI build agent; remove any remote you don't recognize or can't attribute to a trusted publisher.
  • Treat SDK containers the same way you'd treat a build-time dependency in any other ecosystem — pin to a known-good, signed source, and don't add third-party SDK remotes on a whim to unblock a one-off build.
  • For CI pipelines, pin the exact SDK reference (repo + ref + expected checksum where possible) rather than resolving "latest" from a remote you don't control.

Mitigations if you can't patch immediately

  • Avoid --sdk-extension and --base-extensions against any SDK you don't fully trust. The vulnerable code path is only reached when extension copying happens during build-init.
  • Run build-init in a sandboxed or ephemeral environment (disposable container/VM, or a CI runner that is destroyed after each job) so that any traversal write lands somewhere disposable rather than on a persistent developer workstation.
  • Avoid running build-init as a privileged user, and avoid running it against SDKs pulled from ad-hoc or community remotes on machines that also hold sensitive credentials or SSH keys.

Detection Indicators

IndicatorNotes
Unexpected files appearing outside the Flatpak build directory after build-initCompare a filesystem snapshot before/after build-init runs, especially in home directories and config paths reachable via ../ traversal from the build tree
Files or directories unexpectedly deleted around the time build-init ranflatpak_rm_rf clears the destination before writing — missing files near the timestamp of a build-init run are a strong signal
Unfamiliar SDK remotes or repos added to Flatpak configurationRun flatpak remotes and flatpak remote-ls (per remote) and compare against your known-good list
build-init invocations referencing --sdk-extension or --base-extensions against non-standard or newly added remotes, in shell history or CI logsEspecially where the SDK reference does not match your documented build dependencies

Post-Remediation Steps

  1. Confirm the installed Flatpak version on every affected workstation and CI build agent is 1.18.1 or later (mainline) or carries the flatpak-1.16.x backport.
  2. Audit flatpak remotes fleet-wide for unfamiliar or unattributed SDK sources, and remove any that aren't explicitly required and trusted.
  3. On any system that ran build-init --sdk-extension (or --base-extensions) against an SDK from an untrusted or since-removed remote, scan for unexpected file changes outside the relevant build directories, particularly in home-directory config paths.
  4. If a CI/CD build agent was among the affected systems, rotate any credentials, tokens, or SSH keys that agent had access to, and review recent build artifacts it produced for signs of tampering before treating them as trustworthy.

References

  • NVD — CVE-2026-96276
  • GitHub Security Advisory GHSA-8qxj-x646-phcm — Arbitrary write in host context via flatpak build-init
  • Red Hat — CVE-2026-96276
  • Red Hat Bugzilla #2539418
#Flatpak#CVE-2026-96276#Path Traversal#Linux#Supply Chain

Related Articles

CVE-2026-15265: Tenable Agent Path Traversal — Arbitrary File Write & RCE (CVSS 9.1)

A critical path traversal vulnerability in Tenable Agent 11.2.0 and 11.1.3 and earlier allows a privileged attacker to write arbitrary files outside the...

6 min read

CVE-2026-54414: FileRise Path Traversal Enables Arbitrary File Write and Admin Takeover

A critical path traversal vulnerability in FileRise before 3.16.0 allows unauthenticated attackers to write arbitrary files and completely compromise...

5 min read

Cloud Commander Path Traversal Enables Arbitrary File Access (CVE-2026-82460)

CVE-2026-82460 (CVSS 9.8) lets attackers read, write, move, or copy files outside Cloud Commander's root via REST and markdown endpoints.

4 min read
Back to all Security Alerts