Linux AF_UNIX GC vs MSG_PEEK Use-After-Free Container Escape (CVE-2026-53361)
Published: 2026-08-16 • Researcher: sgkdev
- Severity
- Critical
- CVE
- CVE-2026-53361
- Category
- binary
- Affected product
- Linux Kernel (AF_UNIX socket garbage collector)
- Affected versions
- Stable 6.12 up to 6.12.94; Ubuntu 24.04 HWE 6.17 up to 6.17.0-41; RHEL 10; Debian trixie up to 6.12.94+deb13
- Disclosed
- 2026-08-16
- Patch status
- Unverified
Tags
Archive entry
intelseclab/poc-archiveOn this page
Metadata
| Field | Value |
|---|---|
| Date Added | 2026-08-16 |
| Last Updated | 2026-08-16 |
| Author / Researcher | sgkdev |
| CVE / Advisory | CVE-2026-53361 |
| Category | binary |
| Severity | Critical |
| CVSS Score | 9.8 (container escape, unprivileged) |
| Status | Patched |
| Tags | linux, kernel, af-unix, garbage-collector, msg-peek, uaf, container-escape, lpe, slub, dirty-pagetable, CVE-2026-53361 |
| Related | CVE-2021-0920 (same interaction, prior fix), CVE-2026-23394 (second fix attempt) |
Affected Target
| Field | Value |
|---|---|
| Software / System | Linux Kernel (AF_UNIX socket garbage collector) |
| Versions Affected | Stable 6.12 up to 6.12.94; Ubuntu 24.04 HWE 6.17 up to 6.17.0-41; RHEL 10; Debian trixie up to 6.12.94+deb13 |
| Language / Platform | C (x86-64 Linux, static binary) |
| Authentication Required | None – unprivileged user inside a container |
| Network Access Required | Local – must be able to run code inside the target container |
Summary
CVE-2026-53361 is a use-after-free in the Linux AF_UNIX socket garbage collector triggered via a MSG_PEEK race. The GC reclaims in-flight sockets forming unreachable reference cycles, but a concurrent MSG_PEEK can take a reference the GC census never counts. The gc_in_progress flag the peek checks can read false mid-run, letting the peek slip through and creating a dangling sk_buff. This is the same class of bug fixed as CVE-2021-0920 and CVE-2026-23394, with the final fix in commit d82ba05263c6.
The exploit achieves unprivileged container escape through a multi-stage attack: SLUB heap grooming for co-location, KASLR bypass via leaked kernel pointers, dirty pagetable technique for arbitrary kernel memory write, and privilege escalation to root in the init namespace via core_pattern handler hijacking.
Vulnerability Details
Root Cause
The AF_UNIX GC reclaims in-flight socket file descriptors that form unreachable reference cycles. A concurrent MSG_PEEK on an in-flight fd takes a reference the collector never counted, so the GC can free a socket that is still alive, leaving a dangling sk_buff. The peek is supposed to back off while a collection runs, but the gc_in_progress flag it checks can transiently read false mid-run.
Attack Flow
- Race setup: Build AF_UNIX socket graph with in-flight fds forming a reference cycle
- GC race (race#1): Race MSG_PEEK against garbage collection to create dangling sk_buff
- SLUB spray (race#2): Reclaim freed object with controlled data using cg-4k xattr spray to leak kernel pointers
- KASLR defeat: Extract anon_pipe_buf_ops, vmemmap_base, and page_offset_base from leaked heap data
- Dirty pagetable (race#3): Use leaked offsets to forge pipe_buf_operations and hijack page table entries
- Container escape: Overwrite core_pattern to point at the exploit binary, crash a child process to trigger root shell in init namespace
Source Repository
| Field | Value |
|---|---|
| Original URL | https://github.com/sgkdev/bad_garbage |
| Archive Date | 2026-08-16 |
| Stars at Archive | 19 |