Sep 15, 2026·6 min read·57 visits
An interaction flaw between snap-confine and systemd-tmpfiles allows a local unprivileged attacker to take control of tracking directories in /tmp after they are cleaned up, permitting sandbox escape and host root access.
CVE-2026-3888 is a critical local privilege escalation vulnerability arising from the insecure interaction between Canonical's snap-confine helper binary and systemd-tmpfiles within the world-writable /tmp directory.
CVE-2026-3888 represents a local privilege escalation vulnerability within the snapd package manager, specifically affecting the snap-confine helper binary. This vulnerability arises not from an isolated programming error, but from the insecure interaction between snap-confine and the systemd-tmpfiles utility in the world-writable /tmp directory. An unprivileged local attacker can leverage this condition to escape the snap sandbox and obtain administrative root privileges on default installations of Ubuntu Desktop.
To provide confined security boundaries, snap-confine constructs an isolated mount namespace for each snap application. This namespace configuration relies on directory hierarchies created inside the host's /tmp folder, particularly a hidden subdirectory named /tmp/.snap. This subdirectory tracks mount configurations and supports writable overlays, known as mimics, for restricted paths within the read-only snap environment.
The attack surface exists because /tmp is a world-writable directory. When systemd-tmpfiles cleans up aged directories, the tracking directory can be removed while the parent directory remains. An unprivileged local user inside the sandbox can subsequently recreate the directory under their own ownership, creating a mechanism to hijack subsequent administrative mount processes.
The root cause of CVE-2026-3888 is a privilege chaining vulnerability (CWE-268) involving an insecure temporary directory (CWE-377) and a time-of-check to time-of-use (TOCTOU) race condition (CWE-367). The vulnerability is triggered during the daily execution of systemd-tmpfiles-clean.service, which targets inactive files and directories within /tmp. On Ubuntu 24.04 LTS, directories inactive for more than 30 days are purged, while Ubuntu 25.10+ reduces this threshold to 10 days.
While a user remains active within a snap sandbox, the primary temporary directories are continuously accessed. However, the root-owned subdirectory /tmp/.snap, which maintains the state of host mimic mounts, remains inactive and unmodified. This inactivity triggers the cleanup mechanism of systemd-tmpfiles, which recursively deletes /tmp/.snap without evaluating whether active namespace handles still reference the parent container.
Because the host's /tmp directory is configured with the sticky bit (mode 1777), any local user can create new subdirectories inside it. Once systemd-tmpfiles deletes the root-owned /tmp/.snap, an unprivileged user process can instantly recreate /tmp/.snap with their own user identifier (UID). This transition of directory ownership from root to an unprivileged user constitutes the fundamental control-flow breakdown.
The vulnerability's remediation requires modifying the systemd-tmpfiles configuration to prevent the deletion of critical snapd state directories. The original, vulnerable configuration lacked explicit exclusions for the internal tracking directories of snap-private-tmp.
The corrected configuration file, /usr/lib/tmpfiles.d/snapd.conf, introduces specific exclusion rules using the X and x type flags. These directives instruct systemd-tmpfiles to traverse the parent directories without deleting the structure of the enclosed mimic-tracking subdirectories.
# Vulnerable configuration lacked exclusion for .snap subdirectories
# Patched configuration (/usr/lib/tmpfiles.d/snapd.conf):
D! /tmp/snap-private-tmp 0700 root root -
# Exclude private tmp subdirectories from cleanup
X /tmp/snap-private-tmp
X /tmp/snap-private-tmp/*/tmp
x /tmp/snap-private-tmp/*/tmp/.snapAdditionally, the associated TOCTOU vulnerability identified within the Rust-based coreutils rm implementation involved a path-based directory traversal. The fix implemented in commits such as 1183529cd2deafb38bed3b6bf212357b68eefa41 transitioned the deletion process from path-based APIs to file-descriptor-relative calls using openat and unlinkat with the AT_REMOVEDIR flag, preventing directory substitution mid-execution.
The exploitation process requires local access and is structured around a timed race condition. The attacker first establishes a shell inside a confined snap application environment, such as Firefox, and monitors the target /tmp/.snap folder. By continuously interacting with the primary /tmp directory, the attacker keeps it active while waiting for systemd-tmpfiles to delete the untouched /tmp/.snap subdirectory after the 10 or 30-day threshold has passed.
Upon deletion, the attacker immediately recreates /tmp/.snap under their own UID and populates it with a target mimic structure, such as /tmp/.snap/usr/lib/x86_64-linux-gnu. During the next execution of snap-confine, the attacker blocks the execution of the SUID-root helper by restricting the receive buffers on the redirected standard error socket, permitting a slow-stepped inspection of the initialization sequence.
When snap-confine attempts to mount the system libraries, the attacker performs a directory swap using the RENAME_EXCHANGE flag or standard directory replacement. This forces snap-confine to bind-mount the user-controlled library path into the sandbox's /usr/lib/x86_64-linux-gnu directory, allowing the injection of a custom dynamic linker (ld.so) or a preload shared library that executes arbitrary code as root when a SUID process runs inside the container.
The impact of CVE-2026-3888 is a full compromise of system integrity, confidentiality, and availability. Successful exploitation allows an unprivileged local user to escape the strict confinement of the snap sandbox (AppArmor and Seccomp) and execute arbitrary code on the host operating system with administrative root privileges.
This vulnerability is assigned a CVSS v3.1 score of 7.8 (High) with the vector CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:C/C:H/I:H/A:H. The changed scope parameter reflects the ability of the exploit to cross the security boundary established by the snapd mount namespace and influence the hyper-privileged host execution state.
While the EPSS score of 0.00383 reflects a low probability of automated exploitation in the wild, the local nature of the vulnerability makes it highly valuable for targeted privilege escalation campaigns. No user interaction is required to trigger the exploit, and the attack relies entirely on deterministic system processes.
Remediation requires upgrading the snapd package to the patched versions issued by Canonical. For Ubuntu 24.04 LTS, the vulnerability is addressed in 2.73+ubuntu24.04.2. Security administrators must verify that their systems are running versions equal to or greater than the specified patch level to ensure that the malformed tmpfiles configuration is replaced.
If immediate updates cannot be deployed, the risk can be mitigated by manually editing /usr/lib/tmpfiles.d/snapd.conf to append the exclusion rules for /tmp/snap-private-tmp/*/tmp/.snap. After editing the file, administrators must reload the configuration by executing sudo systemctl restart systemd-tmpfiles-clean.service to apply the updated parameters.
Organizations should also audit their environments for the brief window when Ubuntu 25.10 shipped the Rust-based coreutils, ensuring that standard GNU coreutils or patched uutils builds are enforced to mitigate the secondary recursive deletion flaw.
CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:C/C:H/I:H/A:H| Product | Affected Versions | Fixed Version |
|---|---|---|
snapd Canonical | < 2.73+ubuntu24.04.2 | 2.73+ubuntu24.04.2 |
snapd Canonical | < 2.73+ubuntu25.10.1 | 2.73+ubuntu25.10.1 |
| Attribute | Detail |
|---|---|
| CWE ID | CWE-268 |
| Attack Vector | Local |
| CVSS Score | 7.8 |
| EPSS Score | 0.00383 |
| Exploit Status | poc |
| KEV Status | Not Listed |
Privilege Chaining
CVE-2026-55622 (GHSA-qx75-2p3r-pwm5) is an improper access control vulnerability (CWE-284) in Canonical LXD and LXC Incus (tracked as GHSA-c9f5-j9c3-mhrg). In multi-tenant deployments utilizing project-based isolation, the REST API handler for instance creation via POST /1.0/instances verifies that the authenticated user has authorization in the destination project specified by the query parameter, but fails to verify whether the user holds read or view permissions for the source instance when executing a copy operation across projects. Consequently, an authenticated client restricted to a single project can clone instances or snapshots from unauthorized projects into their own project, resulting in complete disclosure of the target instance filesystem and embedded credentials.
An authorization bypass vulnerability in Canonical LXD (tracked as GHSA-7mr3-28h5-m5vx and CVE-2026-55621, and as GHSA-64f3-v33m-w89f in Linux Containers Incus) allows an authenticated user with restricted project access to copy custom storage volumes and volume snapshots from unauthorized projects. The flaw resides in the storagePoolVolumesPost REST API handler, which verifies permissions on the destination project but fails to check whether the caller holds view entitlements on the source project or volume specified in the request body.
A missing authorization and configuration validation vulnerability in Canonical LXD and LXC Incus allows authenticated users within restricted projects to bypass project security boundaries. By smuggling prohibited low-level configuration directives (such as raw.lxc or raw.qemu) inside instance snapshots or backup archives, an attacker can restore these configurations within a restricted project and execute arbitrary commands with root privileges on the underlying host operating system.
A symbolic link traversal vulnerability (CWE-59) in Canonical LXD and Linux Containers Incus allows an authenticated user with image import permissions to read and write arbitrary files on the host filesystem. During image archive unpacking, the daemon fails to reject top-level symbolic links for the instance `templates` directory. Subsequent requests to the instance template API endpoints follow this symbolic link outside the instance storage directory with root privileges, enabling complete host compromise.
CVE-2026-12411 is a broken access control vulnerability in the DevLXD interface of Canonical LXD versions 6.6 through 6.8. The flaw resides in the devLXDInstancePatchHandler component, which fails to verify storage volume ownership when an instance attaches a new disk device via the /dev/lxd guest socket. When the security.devlxd.management.volumes configuration option is enabled, an untrusted guest or DevLXD identity can issue a crafted HTTP PATCH request referencing another tenant's custom storage volume. The LXD host daemon subsequently mounts the target volume into the requesting guest, permitting unauthorized cross-tenant read and write operations.
CVE-2026-105769 (GHSA-5q7h-w9jf-cx97, GO-2026-6225) is an origin validation error and credential exfiltration vulnerability affecting Kaniko prior to version 1.25.20. The flaw stems from an unanchored regular expression in the integrated Azure Container Registry (ACR) credential helper (github.com/chrismellard/docker-credential-acr-env). When Kaniko processes a Dockerfile containing an image reference hosted on a lookalike domain containing an ACR suffix as a substring (e.g., x.azurecr.io.attacker.com), the credential helper acquires a Microsoft Entra ID access token for Azure Resource Manager and transmits it via HTTP POST to the attacker-controlled host.