]> git.kaiwu.me - nginx.git/commitdiff
Upstream: reset parsing state after invalid status line
authorSergey Kandaurov <pluknet@nginx.com>
Wed, 29 Apr 2026 17:56:51 +0000 (21:56 +0400)
committerSergey Kandaurov <s.kandaurov@f5.com>
Wed, 13 May 2026 17:20:55 +0000 (21:20 +0400)
Previously, it was possible to start parsing headers with a wrong
parsing state after status line was not recognized, as a fallback
used in the scgi and uwsgi modules.

Reported by Leo Lin.

src/http/modules/ngx_http_scgi_module.c
src/http/modules/ngx_http_uwsgi_module.c

index 8937464b63961457f925f4a3230e76851e2de93b..290394a1fe14cc9d75abdd082ed6fe9645c3ccc7 100644 (file)
@@ -1036,6 +1036,7 @@ ngx_http_scgi_process_status_line(ngx_http_request_t *r)
 
     if (rc == NGX_ERROR) {
         u->process_header = ngx_http_scgi_process_header;
+        r->state = 0;
         return ngx_http_scgi_process_header(r);
     }
 
index 2f64d745d9f37a0d60bbe9f4b360a224a33031a7..4140b1b4041c4c7cec3cbaf69f8a6f313f84296a 100644 (file)
@@ -1275,6 +1275,7 @@ ngx_http_uwsgi_process_status_line(ngx_http_request_t *r)
 
     if (rc == NGX_ERROR) {
         u->process_header = ngx_http_uwsgi_process_header;
+        r->state = 0;
         return ngx_http_uwsgi_process_header(r);
     }