Files
php-src/tests/security/bug76359.phpt
Ilija Tovilo 9bcdf219ec Resolve open_basedir paths on ini update
Closes GH-10987
2023-07-18 14:43:40 +02:00

20 lines
491 B
PHP

--TEST--
Bug #76359 (open_basedir bypass through adding "..")
--FILE--
<?php
ini_set('open_basedir', __DIR__);
mkdir(__DIR__ . "/bug76359");
chdir(__DIR__ . "/bug76359");
var_dump(ini_set('open_basedir', ini_get('open_basedir') . PATH_SEPARATOR . ".."));
chdir("..");
chdir("..");
?>
--EXPECTF--
string(%d) "%ssecurity"
Warning: chdir(): open_basedir restriction in effect. File(..) is not within the allowed path(s): (%s) in %s on line %d
--CLEAN--
<?php
@rmdir(__DIR__ . "/bug76359");
?>