bin/contrib/rc-httpd{rc-httpd, handlers/error}: do some minimal sanitization on $SERVER_NAME before handing it off to select-handler. this prevents malformed Host: headers from retrieving arbitrary files from the file system. (thanks, Lightning)
This commit is contained in:
parent
bffc3d0b29
commit
d8f8ed14a9
@ -86,6 +86,11 @@ if(~ $#SERVER_NAME 2){
|
||||
SERVER_PORT=$SERVER_NAME(2)
|
||||
SERVER_NAME=$SERVER_NAME(1)
|
||||
}
|
||||
switch($SERVER_NAME){
|
||||
case */* ..
|
||||
error 400
|
||||
exit
|
||||
}
|
||||
if(~ $REQUEST_METHOD (PUT POST)){
|
||||
if(! ~ $"CONTENT_LENGTH '')
|
||||
trim_input | exec $rc_httpd_dir/select-handler
|
||||
|
Loading…
Reference in New Issue
Block a user