]> git.kaiwu.me - nginx.git/commit
HTTP/3: kept the skipped frame length separate from data length
authorVadim Zhestikov <v.zhestikov@f5.com>
Thu, 23 Jul 2026 00:48:55 +0000 (17:48 -0700)
committerSergey Kandaurov <pluknet@nginx.com>
Thu, 1 Oct 2026 17:19:27 +0000 (21:19 +0400)
commit1c173a2d8767730e678c27446138d7ae5dd6fd64
treeed32a04131a690301a64e2e0ad2db009d88a9d8d
parent6adfc05ece48f92446383ec1f145446848694698
HTTP/3: kept the skipped frame length separate from data length

ngx_http_v3_parse_data() stored the remaining length of a skipped
(unknown) frame in st->length -- the same field the request body
filter uses for the number of DATA payload bytes to pass on as
request body.  When an unknown frame was split across parser
invocations, the skip was interrupted with st->length holding the
skip remainder; on the next buffer the body filter, which calls
the parser only while st->length == 0, treated that remainder as
request body.

When proxying, this could result in sending unframed bytes, potentially
allowing for bypass of client_max_body_size, which is enforced only on
the DATA path, or an injection.

The fix is to keep unknown frame payload in a separate st->skip counter.

Reported by Hansol Lee of GOTROOT.
src/http/v3/ngx_http_v3_parse.c
src/http/v3/ngx_http_v3_parse.h