PoC Archive PoC Archive
CVE-2026-53361 category: binary CVSS 9.8 (CRITICAL)
Unverified

Linux AF_UNIX GC vs MSG_PEEK Use-After-Free Container Escape (CVE-2026-53361)

Published: 2026-08-16 • Researcher: sgkdev

Target software 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
Status Patched
Severity Critical · CVSS 9.8
CVSS 9.8/10
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
On this page

Metadata

FieldValue
Date Added2026-08-16
Last Updated2026-08-16
Author / Researchersgkdev
CVE / AdvisoryCVE-2026-53361
Categorybinary
SeverityCritical
CVSS Score9.8 (container escape, unprivileged)
StatusPatched
Tagslinux, kernel, af-unix, garbage-collector, msg-peek, uaf, container-escape, lpe, slub, dirty-pagetable, CVE-2026-53361
RelatedCVE-2021-0920 (same interaction, prior fix), CVE-2026-23394 (second fix attempt)

Affected Target

FieldValue
Software / SystemLinux Kernel (AF_UNIX socket garbage collector)
Versions AffectedStable 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 / PlatformC (x86-64 Linux, static binary)
Authentication RequiredNone – unprivileged user inside a container
Network Access RequiredLocal – 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

  1. Race setup: Build AF_UNIX socket graph with in-flight fds forming a reference cycle
  2. GC race (race#1): Race MSG_PEEK against garbage collection to create dangling sk_buff
  3. SLUB spray (race#2): Reclaim freed object with controlled data using cg-4k xattr spray to leak kernel pointers
  4. KASLR defeat: Extract anon_pipe_buf_ops, vmemmap_base, and page_offset_base from leaked heap data
  5. Dirty pagetable (race#3): Use leaked offsets to forge pipe_buf_operations and hijack page table entries
  6. Container escape: Overwrite core_pattern to point at the exploit binary, crash a child process to trigger root shell in init namespace

Source Repository

FieldValue
Original URLhttps://github.com/sgkdev/bad_garbage
Archive Date2026-08-16
Stars at Archive19