
Linux LPE via snap-confine + systemd-tmpfiles, explained in depth
Disclaimer: This repository is for educational purposes only. All content is based on the original security advisory published by Qualys on March 17, 2026. The vulnerability has been patched-always ensure your systems are up to date. Do not use this material against systems you do not own or have explicit written permission to test.
CVE-2026-3888 is a Local Privilege Escalation (LPE) vulnerability affecting the default installation of Ubuntu Desktop >= 24.04. It was discovered and publicly disclosed by Qualys in March 2026.
What makes this vulnerability particularly interesting-as Qualys themselves noted-is that it does not stem from a single buggy component. Instead, it emerges from the interaction of two individually secure programs:
| Component | Role |
|---|---|
snap-confine | SUID-root binary that builds the mount namespace (sandbox) for snap applications |
systemd-tmpfiles | Root-owned daemon that periodically cleans up stale files in /tmp |
Neither program is broken on its own. Together, they create an exploitable window.
Original advisory: https://cdn2.qualys.com/advisory/2026/03/17/snap-confine-systemd-tmpfiles.txt
Credit: Qualys Security Research Team
cve-2026-3888/
├── README.md ← You are here
├── analysis/
│ ├── 01-vulnerability.md ← Deep dive into the vulnerability
│ ├── 02-race-condition.md ← How the TOCTOU race works
│ ├── 03-backpressure-technique.md ← The AF/UNIX backpressure trick
│ ├── 04-exploitation-steps.md ← Full step-by-step walkthrough
│ └── 05-mitigations.md ← What was patched and how
└── src/
├── firefox_2404.c ← Race helper (annotated)
└── librootshell.c ← Dynamic loader shellcode (annotated)
| Ubuntu Version | Cleanup Age | Wait Time (real) |
|---|---|---|
| 24.04 LTS | 30 days | 30 days |
| > 24.04 | 10 days | 10 days |
Fixed in: snapd 2.74.2
/tmp/.snap as root:root 0755/tmp active with periodic writes, but let /tmp/.snap go stalesystemd-tmpfiles deletes the stale /tmp/.snap - since /tmp is world-writable, the attacker recreates .snap and owns itsnap-confine's executionsnap-confine bind-mounts attacker-owned libraries as root into the namespaceld-linux-x86-64.so.2 with shellcode - any SUID binary executed in this namespace runs our code as root/var/snap/firefox/common/ to get a fully privileged shell