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
| Field | Value |
|---|---|
| CVE ID | CVE-2026-96276 |
| CVSS Score | 9.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. |
| Type | Path Traversal → Arbitrary File Write (and pre-write deletion via flatpak_rm_rf) |
| CWE | CWE-22: Improper Limitation of a Pathname to a Restricted Directory ("Path Traversal") |
| Attack Vector | Local build-time operation (CVSS vector marks it Network, reflecting that the malicious content originates from a remote SDK source) |
| Privileges Required | None |
| User Interaction | None per the CVSS vector, but exploitation requires a developer to actively run flatpak build-init against the malicious SDK — see Condition below |
| Condition | A 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
| Component | Affected Versions | Fixed 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 fix | Backported 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 Area | Description |
|---|---|
| Developer workstation compromise | Attacker-controlled files written (and prior files deleted) outside the sandboxed build directory, on the developer's own filesystem |
| CI/CD build-pipeline compromise | An 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 loss | flatpak_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 poisoning | If 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 --versionConfirm 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 remoteson 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-extensionand--base-extensionsagainst any SDK you don't fully trust. The vulnerable code path is only reached when extension copying happens duringbuild-init. - Run
build-initin 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-initas 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
| Indicator | Notes |
|---|---|
Unexpected files appearing outside the Flatpak build directory after build-init | Compare 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 ran | flatpak_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 configuration | Run 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 logs | Especially where the SDK reference does not match your documented build dependencies |
Post-Remediation Steps
- 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.
- Audit
flatpak remotesfleet-wide for unfamiliar or unattributed SDK sources, and remove any that aren't explicitly required and trusted. - 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. - 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.