http server: chunk extensions rejected, connection closed with no response
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 56/100
Direzione di ricerca
Start with lib/monkey/mk_server/mk_http_parser.c, especially http_parser_transfer_encoding_chunked() and the check at line 606 described in the report. Reproduce with the supplied chunked request and compare it with the 7 control case. Done means chunk extensions are accepted and the request receives the expected response; the related malformed-input response behavior may need separate scope.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Bug Report
Describe the bug
The HTTP server rejects any chunked request that uses a chunk extension (RFC 9112 §7.1.1, formerly
RFC 7230 §4.1) and closes the connection without sending any HTTP response at all — not a 400, nothing.
The client sees a bare EOF and cannot distinguish it from a transport failure.
To Reproduce
Start an http input on port 9880, then send this raw request:
POST / HTTP/1.1
Host: x
Content-Type: application/json
Transfer-Encoding: chunked
7;a=b\r\n{"a":1}\r\n0\r\n\r\n
Result: connection closed immediately (EOF at 0.00 s), no response bytes. The server itself stays healthy
and the next request returns 201.
All of these fail identically:
| chunk-size line | result |
|---|---|
7;a=b |
EOF, no response |
7; (empty extension) |
EOF, no response |
7;a="b c" (quoted value) |
EOF, no response |
0;a=b (terminator with extension) |
EOF, no response |
7 (trailing space) |
EOF, no response |
7 (control) |
201 |
Chunked itself works fine otherwise: splitting the body across chunks, one byte per chunk, and uppercase hex
all return 201. Reproduces on the monitoring server (:2020) as well.
Root cause
lib/monkey/mk_server/mk_http_parser.c, http_parser_transfer_encoding_chunked():
memcpy(tmp, p->chunk_processed_start, len); /* whole chunk-size line, up to CRLF */
tmp[len] = '\0';
chunk_len = strtol(tmp, &ptr, 16);
...
if (ptr == tmp || *ptr != '\0') { /* line 606 */
return MK_HTTP_PARSER_ERROR;
}
The parser copies the entire chunk-size line and then requires strtol to have consumed all of it.
strtol stops at the ;, so *ptr is ; and the request is treated as a parse error. The same check also
rejects a trailing space after the size.
Expected behavior
The extension should be ignored (or parsed) and the chunk length taken from the hex prefix, so the request
succeeds with 201.
Second, related issue
Every MK_HTTP_PARSER_ERROR closes the connection with no response, so malformed chunked input is
indistinguishable from a network drop (a plain ZZZ chunk size behaves the same way). A 400 would be the
expected behaviour.
Your Environment
- Fluent Bit 5.1.5 (
fluent/fluent-bit:latest), also present on currentmaster— the lines above are
unchanged there - Linux, aarch64, official container image
- Input:
httpplugin, default settings
Impact
Any client, proxy or SDK that emits chunk extensions gets a silent failure with no status code and nothing
to log or retry on. 0;a=b means even a correctly terminated body fails.
- Lingua principale
- C
- Stelle
- 8.2k
- Fork
- 2k
- Merge medio
- 3g 20h
- PR unite (30g)
- 99
Preparare l'ambiente
Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.
- Include un Dockerfile o un file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di fluent/fluent-bit
-
in_tail: files falsely detected as rotated on macOS with threaded inputs, causing duplicate recordsForse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
fluent/fluent-bit#12780 ·
I maintainer di solito rispondono entro 1 giorno
-
status: waiting-for-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
fluent/fluent-bit#12683 · 2 commenti · 6 reazioni ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
fluent/fluent-bit#12657 ·
I maintainer di solito rispondono entro 1 giorno
-
http: Transfer-Encoding chunked plus Content-Length hangs forever (CL branch shadows the chunked path)Forse già presa @sarankumar1325 l’ha presa 14 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
fluent/fluent-bit#12656 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
fluent/fluent-bit#12649 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di fluent/fluent-bit
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
micropython/micropython#19942 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 3 giorni
-
快速入门那里会不会对新手不太友好,提出优化方案Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 84/100
-
-disable-symbolserver is ignored on macOS/Linux: PDBs are still downloaded from msdl.microsoft.comAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100