mirror of
https://github.com/nginx/nginx.git
synced 2025-02-25 18:55:26 -06:00
Upstream: check format of CGI Status header
The CGI Status header is used as the HTTP status line if it has a
reason-phrase: its length should be > 3.
This change validates that the 4th character is a space, the only
allowed character in that position.
An addition to:
fa46a57199
This commit is contained in:
parent
e28ef42b97
commit
cc536f9ca9
@ -2049,7 +2049,7 @@ ngx_http_fastcgi_process_header(ngx_http_request_t *r)
|
||||
|
||||
u->headers_in.status_n = status;
|
||||
|
||||
if (status_line->len > 3) {
|
||||
if (status_line->len > 3 && status_line->data[3] == ' ') {
|
||||
u->headers_in.status_line = *status_line;
|
||||
}
|
||||
|
||||
|
@ -1154,7 +1154,7 @@ ngx_http_scgi_process_header(ngx_http_request_t *r)
|
||||
|
||||
u->headers_in.status_n = status;
|
||||
|
||||
if (status_line->len > 3) {
|
||||
if (status_line->len > 3 && status_line->data[3] == ' ') {
|
||||
u->headers_in.status_line = *status_line;
|
||||
}
|
||||
|
||||
|
@ -1382,7 +1382,7 @@ ngx_http_uwsgi_process_header(ngx_http_request_t *r)
|
||||
|
||||
u->headers_in.status_n = status;
|
||||
|
||||
if (status_line->len > 3) {
|
||||
if (status_line->len > 3 && status_line->data[3] == ' ') {
|
||||
u->headers_in.status_line = *status_line;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user