[PATCH 09 of 10] From f79c286b34d3b708bd4856a56e27529e11386098 Mon Sep 17 00:00:00 2001

Maxim Dounin mdounin at mdounin.ru
Sun May 17 00:12:42 UTC 2026


# HG changeset patch
# User Sergey Kandaurov <pluknet at nginx.com>
# Date 1777485411 -14400
#      Wed Apr 29 21:56:51 2026 +0400
# Node ID f4515f0ba7bcf8f0c7ed6e4e2024c051b39c31f1
# Parent  4f8c88f32b9723c688fd76c121f8f39361967097
>From f79c286b34d3b708bd4856a56e27529e11386098 Mon Sep 17 00:00:00 2001
Upstream: reset parsing state after invalid status line.

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.

Obtained from:
https://github.com/nginx/nginx/commit/f79c286b34d3b708bd4856a56e27529e11386098

diff --git a/src/http/modules/ngx_http_scgi_module.c b/src/http/modules/ngx_http_scgi_module.c
--- a/src/http/modules/ngx_http_scgi_module.c
+++ b/src/http/modules/ngx_http_scgi_module.c
@@ -1016,6 +1016,7 @@ ngx_http_scgi_process_status_line(ngx_ht
 
     if (rc == NGX_ERROR) {
         u->process_header = ngx_http_scgi_process_header;
+        r->state = 0;
         return ngx_http_scgi_process_header(r);
     }
 
diff --git a/src/http/modules/ngx_http_uwsgi_module.c b/src/http/modules/ngx_http_uwsgi_module.c
--- a/src/http/modules/ngx_http_uwsgi_module.c
+++ b/src/http/modules/ngx_http_uwsgi_module.c
@@ -1245,6 +1245,7 @@ ngx_http_uwsgi_process_status_line(ngx_h
 
     if (rc == NGX_ERROR) {
         u->process_header = ngx_http_uwsgi_process_header;
+        r->state = 0;
         return ngx_http_uwsgi_process_header(r);
     }
 



More information about the nginx-devel mailing list