diff options
author | Mark Wells <mark@freeside.biz> | 2015-07-10 18:15:08 -0700 |
---|---|---|
committer | Mark Wells <mark@freeside.biz> | 2015-07-10 18:15:08 -0700 |
commit | 88bf5db0cca989c51237c661a13078eef08b3674 (patch) | |
tree | 0a84e1b5e7fd239f57fab678bf40c5311b0064a0 /rt/t/web/path-traversal.t | |
parent | 9c15ffe3a5ee987e30e10c6a0ad1b5bf0b2a12e3 (diff) | |
parent | e7eb845db1afab1cbdbc34ff9c387c5ac554659e (diff) |
Merge branch 'FREESIDE_4_BRANCH' of git.freeside.biz:/home/git/freeside into 4.x
Diffstat (limited to 'rt/t/web/path-traversal.t')
-rw-r--r-- | rt/t/web/path-traversal.t | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/rt/t/web/path-traversal.t b/rt/t/web/path-traversal.t index 01302e672..8207265ef 100644 --- a/rt/t/web/path-traversal.t +++ b/rt/t/web/path-traversal.t @@ -8,35 +8,30 @@ ok($agent->login); $agent->get("$baseurl/NoAuth/../Elements/HeaderJavascript"); is($agent->status, 400); -$agent->warning_like(qr/Invalid request.*aborting/,); +$agent->warning_like(qr/Invalid request.*aborting/); $agent->get("$baseurl/NoAuth/../%45lements/HeaderJavascript"); is($agent->status, 400); -$agent->warning_like(qr/Invalid request.*aborting/,); +$agent->warning_like(qr/Invalid request.*aborting/); $agent->get("$baseurl/NoAuth/%2E%2E/Elements/HeaderJavascript"); is($agent->status, 400); -$agent->warning_like(qr/Invalid request.*aborting/,); +$agent->warning_like(qr/Invalid request.*aborting/); $agent->get("$baseurl/NoAuth/../../../etc/RT_Config.pm"); is($agent->status, 400); -SKIP: { - skip "Apache rejects busting up above / for us", 2 if $ENV{RT_TEST_WEB_HANDLER} =~ /^apache/; - $agent->warning_like(qr/Invalid request.*aborting/,); -}; +$agent->warning_like(qr/Invalid request.*aborting/) unless $ENV{RT_TEST_WEB_HANDLER} =~ /^apache/; -$agent->get("$baseurl/NoAuth/css/web2/images/../../../../../../etc/RT_Config.pm"); -is($agent->status, 400); -SKIP: { - skip "Apache rejects busting up above / for us", 2 if $ENV{RT_TEST_WEB_HANDLER} =~ /^apache/; - $agent->warning_like(qr/Invalid request.*aborting/,); -}; +$agent->get("$baseurl/static/css/web2/images/../../../../../../etc/RT_Config.pm"); +# Apache hardcodes a 400m but the static handler returns a 403 for traversal too high +is($agent->status, $ENV{RT_TEST_WEB_HANDLER} =~ /^apache/ ? 400 : 403); # Do not reject a simple /. in the URL, for downloading uploaded # dotfiles, for example. $agent->get("$baseurl/Ticket/Attachment/28/9/.bashrc"); is($agent->status, 200); # Even for a file not found, we return 200 -$agent->content_contains("Bad attachment id"); +$agent->next_warning_like(qr/could not be loaded/, "couldn't loaded warning"); +$agent->content_like(qr/Attachment \S+ could not be loaded/); # do not reject these URLs, even though they contain /. outside the path $agent->get("$baseurl/index.html?ignored=%2F%2E"); |