xref: /PHP-7.4/tests/security/bug76359.phpt (revision ee9e0754)
1--TEST--
2Bug #76359 (open_basedir bypass through adding "..")
3--FILE--
4<?php
5ini_set('open_basedir', __DIR__);
6mkdir(__DIR__ . "/bug76359");
7chdir(__DIR__ . "/bug76359");
8var_dump(ini_set('open_basedir', ini_get('open_basedir') . PATH_SEPARATOR . ".."));
9chdir("..");
10chdir("..");
11?>
12--EXPECTF--
13bool(false)
14
15Warning: chdir(): open_basedir restriction in effect. File(..) is not within the allowed path(s): (%s) in %s on line %d
16--CLEAN--
17<?php
18@rmdir(__DIR__ . "/bug76359");
19?>
20