PHP  
 PHP_7_0
downloads | QA | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | my php.net 
 

Test Failure Report for sapi/cli/tests/bug70264.phpt ('Bug #70264 (CLI server directory traversal)')

Script

1: <?php
2:
include "php_cli_server.inc";
3:
php_cli_server_start(nullnull);
4: echo 
file_get_contents("http://" PHP_CLI_SERVER_ADDRESS "/..\\CREDITS");
5: echo 
file_get_contents("http://" PHP_CLI_SERVER_ADDRESS "/..%5CCREDITS");
6:
?>
7:

Expected

Warning: file_get_contents(http://%s/..\CREDITS): failed to open stream: HTTP request failed! HTTP/1.0 404 Not Found
 in %sbug70264.php on line %d

Warning: file_get_contents(http://%s/..%5CCREDITS): failed to open stream: HTTP request failed! HTTP/1.0 404 Not Found
 in %sbug70264.php on line %d

Output

Unable to connect to server

Diff

001+ Unable to connect to server
001- Warning: file_get_contents(http://%s/..\CREDITS): failed to open stream: HTTP request failed! HTTP/1.0 404 Not Found
002-  in %sbug70264.php on line %d
003- 
004- Warning: file_get_contents(http://%s/..%5CCREDITS): failed to open stream: HTTP request failed! HTTP/1.0 404 Not Found
005-  in %sbug70264.php on line %d

 

Generated at Wed, 20 Sep 2017 13:49:37 +0000 (2 days ago)

Copyright © 2005-2017 The PHP Group
All rights reserved.