HTTP request smuggling primitive: bare LF accepted as a request-line terminator in strict mode
Maintainer thường phản hồi trong vòng 6 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 55/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- node.js, typescript
- Lĩnh vực
- backend-api-design, security
Hướng nghiên cứu
Bắt đầu tại url.ts:176 và lần theo url.exit.toHTTP09 đến headers_start, so sánh nhánh LF đơn với kiểm tra LENIENT_OPTIONAL_CR_BEFORE_LF được dùng cho các request-line terminator khác. Bổ sung kiểm thử hồi quy cho các request không có version và có version trong strict mode, sau đó xác minh rằng strict mode từ chối trường hợp LF đơn mà không parse header HTTP/0.9 hoặc body.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
llhttp_set_lenient_optional_cr_before_lf documents that llhttp "would error when a LF is not
preceded by CR when terminating the request line", and that relaxing this exposes request smuggling.
url.ts:176 exits on a bare \n straight to the HTTP/0.9 adapter with no
LENIENT_OPTIONAL_CR_BEFORE_LF check — the only line terminator in the grammar that is ungated.
url.exit.toHTTP09 then continues into headers_start with no http_minor guard, so the message is
labelled HTTP/0.9 but headers and a Content-Length body are still parsed.
PoC
const http = require('http'), net = require('net');
const srv = http.createServer((req, res) => { // default parser, no options
let body = '';
req.on('data', c => body += c);
req.on('end', () => {
console.log(` ACCEPTED HTTP/${req.httpVersion} ${req.method} ${req.url}` +
` headers=${JSON.stringify(req.headers)} body=${JSON.stringify(body)}`);
res.end('ok');
});
});
srv.on('clientError', e => console.log(` REJECTED ${e.code}`));
const cases = [
['versionless + bare LF', 'GET /x\nHost: a\r\nContent-Length: 5\r\n\r\nhello'],
['versioned + bare LF', 'GET /x HTTP/1.1\nHost: a\r\n\r\n'],
];
srv.listen(0, async () => {
for (const [name, raw] of cases) {
console.log(name);
await new Promise(done => {
const c = net.connect(srv.address().port, '127.0.0.1', () => c.write(raw));
c.on('close', done); c.on('error', done);
setTimeout(() => c.destroy(), 300);
});
}
srv.close();
});
versionless + bare LF
ACCEPTED HTTP/0.9 GET /x headers={"host":"a","content-length":"5"} body="hello"
versioned + bare LF
REJECTED HPE_INVALID_VERSION
The same terminator is rejected when a version is present and accepted when it is absent. The
accepted message is reported as HTTP/0.9 yet carries headers and a body, neither of which HTTP/0.9
defines.
Scope, stated plainly: this path sets keepalive=0, and a pipelined follow-up request is rejected
with HPE_CLOSED_CONNECTION, so on its own it is a divergence from the documented strict-mode
guarantee rather than a demonstrated desync. Two requests parse on one connection only with
lenient_keep_alive also enabled.
- Ngôn ngữ chính
- TypeScript
- Star
- 2k
- Fork
- 236
- Merge trung bình
- 5 ngày 2 giờ
- Pull request đã merge (30 ngày)
- 1
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của nodejs/llhttp
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 6 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 52/100
nodejs/llhttp#876 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 6 ngày
-
Not easy to get the number of methods llhttp hasCó thể đã có người làm @official-burak đã nhận 54 ngày trước. Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 54/100
Maintainer thường phản hồi trong vòng 6 ngày
-
Should there be a way to block requests with multiple hosts or none are sent?Có thể đã có người làm @Vizonex đã nhận 202 ngày trước. Đang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 32/100
nodejs/llhttp#816 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 6 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 45/100
nodejs/llhttp#782 · 2 bình luận · 4 reaction ·
Maintainer thường phản hồi trong vòng 6 ngày
Tất cả issue của nodejs/llhttp
Issue tương tự
-
e2e-failure ready-to-code
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 79/100
redhat-developer/rhdh-plugin-export-overlays#4580 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
devdotfast/whiteboard#1415 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area/sessions comp/desktop desktop/sessions P2 type/bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
NousResearch/hermes-agent#145383 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement p2 setup
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
vercel/eve#5419 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày