Restrict duplicate TE headers in HTTP/2 and HTTP/3

Following d3a76322cf, this change rejects requests which have multiple
TE headers.

Reported-by: geeknik <geeknik@protonmail.ch>
This commit is contained in:
Roman Arutyunyan 2026-04-15 13:49:00 +04:00 committed by Roman Arutyunyan
parent ff8221b4db
commit 4e89ce224f
2 changed files with 4 additions and 2 deletions

View file

@ -3849,7 +3849,8 @@ ngx_http_v2_run_request(ngx_http_request_t *r)
}
if (r->headers_in.te
&& (r->headers_in.te->value.len != 8
&& (r->headers_in.te->next
|| r->headers_in.te->value.len != 8
|| ngx_strncasecmp(r->headers_in.te->value.data,
(u_char *) "trailers", 8) != 0))
{

View file

@ -1050,7 +1050,8 @@ ngx_http_v3_process_request_header(ngx_http_request_t *r)
}
if (r->headers_in.te
&& (r->headers_in.te->value.len != 8
&& (r->headers_in.te->next
|| r->headers_in.te->value.len != 8
|| ngx_strncasecmp(r->headers_in.te->value.data,
(u_char *) "trailers", 8) != 0))
{