HTTP server: `EIGS_HTTP_MAX_BODY=1e6` gives a body limit of 1 byte (six limit variables keep only a value's leading digits)
Maintainer thường phản hồi trong vòng 1 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
- 53/100
Hướng nghiên cứu
Start with the limit parsing in src/ext_http.c and the EIGS_HTTP_MAX_HEAD rule added in #2370; read docs/BUILTINS.md for the documented variable rules. Add coverage for all six variables using the listed values and a planted fault that reproduces the current parsing behavior. Done means the parsing rule and invalid-value behavior are decided, tests cover every variable, and docs/BUILTINS.md documents each rule.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Found while building #2370, whose text leaves it out by name: "EIGS_HTTP_MAX_BODY is read more loosely today, and that is not changed here".
What happens today
Run on the branch of #2370 at 5fc6d926 (make http). The function that reads the variable is the same there as at 5b93b236, the head of phase2-numbers. A server with one POST route was started with the variable set, and bodies of 1, 2, 5, 6, 16, 17, 100,000 and 17,000,000 bytes were sent, each with its Content-Length:
EIGS_HTTP_MAX_BODY |
the limit the server then has |
|---|---|
unset, 0, -5, abc, 0x10 |
the default, 16 MiB |
1e6 |
1 byte: a body of 2 bytes is answered 413 |
16MiB |
16 bytes |
5x |
5 bytes |
6 (a space first), +6, 6.9 |
6 bytes |
99999999999999999999 |
none that these sizes reach: the body of 17,000,000 bytes is served |
http_max_body in src/ext_http.c reads the value with strtol(env, &end, 10) and takes the number when at least one digit was read and it is over zero. What follows the digits is not looked at, and a value too large for a long becomes the largest long.
Five more variables of the server are read by the same lines: EIGS_HTTP_MAX_BODY_TOTAL, EIGS_HTTP_MAX_CONN_PER_IP, EIGS_HTTP_HEADER_TIMEOUT, EIGS_HTTP_HEADER_MIN_RATE and EIGS_HTTP_SHARED_MAX_BYTES. Those five were read in the source and not run.
EIGS_HTTP_MAX_HEAD, which #2370 adds, has a rule: one to nine decimal digits and not zero, and any other value leaves the default.
Why it matters
A limit written as 1e6 or 16MiB gives a server that refuses every request with a body of more than a few bytes, and nothing says why. A value that is too large takes the limit away.
Done when
- Each of the server's limit variables is read by one stated rule (the rule of
EIGS_HTTP_MAX_HEAD, or another written indocs/BUILTINS.md), and a value that breaks the rule never becomes a number other than the one written. - What a value that breaks the rule does is decided in this issue before it is built, one way for all of them: it leaves the default, as
EIGS_HTTP_MAX_HEADdoes, orhttp_serverefuses to start and names the variable. - A row for each variable with the values of the table above, and a planted fault (today's reading) that turns each row red.
-
docs/BUILTINS.mdgives the rule beside each variable.
- Ngôn ngữ chính
- C
- Star
- 3
- Fork
- 7
- Merge trung bình
- 3 giờ 28 phút
- Pull request đã merge (30 ngày)
- 270
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Có Dockerfile hoặc tệp Docker Compose
- 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 InauguralSystems/EigenScript
-
area:gates kind:gate-defect
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 83/100
InauguralSystems/EigenScript#2476 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area:gates needs-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
InauguralSystems/EigenScript#2462 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
The hosted-RNG check refuses a clean tree that has a tracked file with a double quote in its nameĐang mởarea:gates kind:gate-defect needs-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
InauguralSystems/EigenScript#2461 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area:gates kind:gate-defect needs-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
InauguralSystems/EigenScript#2458 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
`http_post`: `headers` text with something after its JSON value now means no headers, without a wordĐang mởarea:http kind:silent-wrong
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
InauguralSystems/EigenScript#2394 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của InauguralSystems/EigenScript
Issue tương tự
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 92/100
flipperdevices/flipperzero-firmware#4520 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area/build-framework kind/enhancement priority/low
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
yugabyte/yugabyte-db#38826 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
meshcore-dev/MeshCore#3891 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug grammar sev-3
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
-
BUG/MEDIUM: regex: worker SIGSEGV when a regex is applied to an empty body on libc-regex buildsĐang mởstatus: needs-triage type: bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100