fix parsing of chunk-extension lines that previously failed to skip the \r\n properly; might be abused for HTTP request smuggling; thanks to A. Ramos for reporting

This commit is contained in:
Christian Grothoff
2026-07-27 18:00:30 +02:00
parent 29eaa56b31
commit c13f4c6484
+2 -2
View File
@@ -4651,13 +4651,13 @@ process_request_body (struct MHD_Connection *connection)
if (i + 1 == available)
break; /* need more data */
if ('\n' == buffer_head[i + 1])
chunk_size_line_len = i; /* Valid chunk header */
chunk_size_line_len = i + 2; /* Valid chunk header */
}
else
{
mhd_assert ('\n' == buffer_head[i]);
if (bare_lf_as_crlf)
chunk_size_line_len = i; /* Valid chunk header */
chunk_size_line_len = i + 1; /* Valid chunk header */
}
/* The chunk header is broken
if chunk_size_line_len is zero here. */