# HG changeset patch # User Roman Arutyunyan # Date 1653567476 -14400 # Node ID 5b1011b5702b5c5db2ba3d392a4da25596183cc2 # Parent c2f5d79cde64457f1fa7344c56a5248a677a7e46 HTTP/3: require that field section base index is not negative. RFC 9204 explicitly requires that. diff --git a/src/http/v3/ngx_http_v3_parse.c b/src/http/v3/ngx_http_v3_parse.c --- a/src/http/v3/ngx_http_v3_parse.c +++ b/src/http/v3/ngx_http_v3_parse.c @@ -474,7 +474,13 @@ done: } if (st->sign) { + if (st->insert_count <= st->delta_base) { + ngx_log_error(NGX_LOG_INFO, c->log, 0, "client sent negative base"); + return NGX_HTTP_V3_ERR_DECOMPRESSION_FAILED; + } + st->base = st->insert_count - st->delta_base - 1; + } else { st->base = st->insert_count + st->delta_base; }