http: Transfer-Encoding chunked plus Content-Length hangs forever (CL branch shadows the chunked path)
Los mantenedores suelen responder en 1 día
@sarankumar1325 ya está trabajando en esto.
Desde el 29/10/2026.
- #12692 de @sarankumar1325 — abierto
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 76/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- c
- Área
- backend, networking, security
Línea de trabajo
Empieza por la rama REQ_LEVEL_BODY en lib/monkey/mk_server/mk_http_parser.c y sigue cómo se llega a mk_http_parser_is_content_chunked() y http_parser_transfer_encoding_chunked(). Reproduce la solicitud proporcionada con ambas cabeceras y compárala con la solicitud chunked sin Content-Length. La tarea estará terminada cuando la solicitud se analice como chunked y devuelva 201 en lugar de quedarse bloqueada.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Bug Report
Describe the bug
A request carrying both Transfer-Encoding: chunked and Content-Length never completes. The server reads the
whole chunked body, then waits forever for Content-Length bytes that will never arrive, and the request is never
processed or answered.
This is the classic request-smuggling header pair, so it matters beyond a simple hang.
To Reproduce
POST / HTTP/1.1
Host: x
Content-Type: application/json
Transfer-Encoding: chunked
Content-Length: 100
7\r\n{"a":1}\r\n0\r\n\r\n
Result: no response (hangs to the 10 s timeout), and no record is emitted. Reproducible every time. The same
request with Content-Length: 2 instead of 100 also hangs, so it is not about the value — merely having the
header is enough.
Without Content-Length the identical chunked request returns 201.
Root cause
lib/monkey/mk_server/mk_http_parser.c, in the main parse loop at REQ_LEVEL_BODY:
else if (p->level == REQ_LEVEL_BODY) {
if (p->header_content_length > 0) {
p->body_received = len - p->start;
if ((len - p->start) < p->header_content_length) {
return MK_HTTP_PARSER_PENDING; /* <- never gets past here */
}
...
}
return mk_http_parser_ok(req, p, buffer, buf_len, server);
}
The chunked handling lives in mk_http_parser_ok(), which is only reached after this branch. So when
Content-Length is present the CL path is taken first and returns PENDING, and mk_http_parser_ok() — which
would have dispatched to http_parser_transfer_encoding_chunked() — is never called.
The branch should be if (p->header_content_length > 0 && !mk_http_parser_is_content_chunked(p)), or the chunked
case should be checked first.
Expected behavior
Transfer-Encoding: chunked takes precedence over Content-Length (RFC 9112 §6.3), so the request should be
parsed as chunked and answered with 201.
Your Environment
- Fluent Bit 5.1.5 (
fluent/fluent-bit:latest) - Linux, aarch64, official container image
- Input:
httpplugin, default settings
Impact
Pre-auth. Any client or proxy that sends both headers — common, since many stacks add Content-Length alongside
chunked encoding — gets a hang and a lost record. Because the two headers are interpreted differently from what
RFC 9112 requires, it is also a request-smuggling candidate when Fluent Bit sits behind a proxy that prefers
Content-Length.
- Lenguaje dominante
- C
- Estrellas
- 8.2k
- Forks
- 2k
- Merge medio
- 3 d 20 h
- PR fusionados (30 d)
- 99
Preparar el entorno
Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.
- Incluye un Dockerfile o un archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de fluent/fluent-bit
-
in_tail: files falsely detected as rotated on macOS with threaded inputs, causing duplicate recordsPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
fluent/fluent-bit#12780 ·
Los mantenedores suelen responder en 1 día
-
status: waiting-for-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
fluent/fluent-bit#12683 · 2 comentarios · 6 reacciones ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
fluent/fluent-bit#12657 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
fluent/fluent-bit#12649 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 79/100
fluent/fluent-bit#12636 ·
Los mantenedores suelen responder en 1 día
Todos los issues de fluent/fluent-bit
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
micropython/micropython#19942 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 3 días
-
快速入门那里会不会对新手不太友好,提出优化方案Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 84/100
-
-disable-symbolserver is ignored on macOS/Linux: PDBs are still downloaded from msdl.microsoft.comAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100