mirror of
https://github.com/nginx/nginx.git
synced 2026-05-13 09:36:42 +00:00
Reject HTTP CONNECT method with no port after colon
Some checks failed
buildbot / buildbot (push) Has been cancelled
Some checks failed
buildbot / buildbot (push) Has been cancelled
This commit is contained in:
parent
631bfa194d
commit
a43c76b4e3
1 changed files with 15 additions and 1 deletions
|
|
@ -120,6 +120,7 @@ ngx_http_parse_request_line(ngx_http_request_t *r, ngx_buf_t *b)
|
|||
sw_host,
|
||||
sw_host_end,
|
||||
sw_host_ip_literal,
|
||||
sw_port_start,
|
||||
sw_port,
|
||||
sw_after_slash_in_uri,
|
||||
sw_check_uri,
|
||||
|
|
@ -388,7 +389,7 @@ ngx_http_parse_request_line(ngx_http_request_t *r, ngx_buf_t *b)
|
|||
case sw_host_end:
|
||||
|
||||
if (ch == ':') {
|
||||
state = sw_port;
|
||||
state = sw_port_start;
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
@ -464,6 +465,19 @@ ngx_http_parse_request_line(ngx_http_request_t *r, ngx_buf_t *b)
|
|||
}
|
||||
break;
|
||||
|
||||
case sw_port_start:
|
||||
state = sw_port;
|
||||
|
||||
if (ch >= '0' && ch <= '9') {
|
||||
break;
|
||||
}
|
||||
|
||||
if (r->method == NGX_HTTP_CONNECT) {
|
||||
return NGX_HTTP_PARSE_INVALID_REQUEST;
|
||||
}
|
||||
|
||||
/* fall through */
|
||||
|
||||
case sw_port:
|
||||
if (ch >= '0' && ch <= '9') {
|
||||
break;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue