# HG changeset patch # User Ruslan Ermilov <ru@nginx.com> # Date 1541510989 -10800 # Node ID e7f19d268c72db6908cc467fbba9df402c3389b8 # Parent d4448892a2943f27e5360705c719bfd045c8ef26 HTTP/2: limit the number of idle state switches. An attack that continuously switches HTTP/2 connection between idle and active states can result in excessive CPU usage. This is because when a connection switches to the idle state, all of its memory pool caches are freed. This change limits the maximum allowed number of idle state switches to 10 * http2_max_requests (i.e., 10000 by default). This limits possible CPU usage in one connection, and also imposes a limit on the maximum lifetime of a connection. Initially reported by Gal Goldshtein from F5 Networks. diff -r d4448892a294 -r e7f19d268c72 src/http/v2/ngx_http_v2.h --- a/src/http/v2/ngx_http_v2.h Tue Nov 06 16:29:35 2018 +0300 +++ b/src/http/v2/ngx_http_v2.h Tue Nov 06 16:29:49 2018 +0300 @@ -121,6 +121,7 @@ ngx_uint_t processing; ngx_uint_t frames; + ngx_uint_t idle; size_t send_window; size_t recv_window;