48 | | diff -aruN nginx-1.21.6/src/http/ngx_http_parse.c nginx/src/http/ngx_http_parse.c |
49 | | --- nginx-1.21.6/src/http/ngx_http_parse.c 2022-01-25 16:03:52.000000000 +0100 |
50 | | +++ nginx/src/http/ngx_http_parse.c 2022-09-30 17:38:02.176503090 +0200 |
51 | | @@ -1526,7 +1526,7 @@ |
52 | | ch = *p++; |
53 | | break; |
54 | | |
55 | | - } else if (ch == '\0') { |
56 | | + } else if (ch < 0x20 || ch == 0x7f) { |
57 | | return NGX_HTTP_PARSE_INVALID_REQUEST; |
58 | | } |
59 | | |
60 | | @@ -1546,6 +1546,8 @@ |
61 | | |
62 | | } else if (ch == '+') { |
63 | | r->plus_in_uri = 1; |
64 | | + } else if (ch < 0x20 || ch == 0x7f) { |
65 | | + return NGX_HTTP_PARSE_INVALID_REQUEST; |
66 | | } |
67 | | |
68 | | state = quoted_state; |
| 48 | Same crafted curl gives me now: |
| 49 | < HTTP/1.1 400 Bad Request |
| 50 | < Server: nginx/1.21.6 |