mirror of
https://github.com/nginx/nginx.git
synced 2024-11-21 16:28:40 +00:00
HTTP/3: limited prefixed integers encoded length.
Similar to ngx_http_v2_module, the implementation limit is now set to 4 bytes length, see NGX_HTTP_V2_INT_OCTETS in ngx_http_v2_parse_int(). For example, this limits a maximum integer value encoded with a 7-bit prefix to 2097278, with similar limits using other prefixes.
This commit is contained in:
parent
042b9cc4db
commit
bd4b251bbc
@ -217,9 +217,7 @@ ngx_http_v3_parse_prefix_int(ngx_connection_t *c,
|
||||
|
||||
st->value += (uint64_t) (ch & 0x7f) << st->shift;
|
||||
|
||||
if (st->shift == 56
|
||||
&& ((ch & 0x80) || (st->value & 0xc000000000000000)))
|
||||
{
|
||||
if (st->shift == 21) {
|
||||
ngx_log_error(NGX_LOG_INFO, c->log, 0,
|
||||
"client exceeded integer size limit");
|
||||
return NGX_HTTP_V3_ERR_EXCESSIVE_LOAD;
|
||||
|
Loading…
Reference in New Issue
Block a user