Fix #76359: open_basedir bypass through adding ".."#7024
Fix #76359: open_basedir bypass through adding ".."#7024cmb69 wants to merge 3 commits intophp:PHP-7.4from
Conversation
We explicitly forbid adding `..` to `open_basedir`at runtime.
|
It was actually my intention to target PHP-7.4. |
What is the impl. issue with this? It should be possible to normalize the set value before it is used in the check and then when the fixed value contains |
That would be a behavioral change. As it is, relative paths, and absolute paths containing |
|
Then simply store the unnormalized path (if check passed of course) :) |
That's what we're doing. But relative paths depend on the CWD, which might change later. |
|
https://bugs.php.net/bug.php?id=76359 看了一眼居然是三年前就捅出来的问题。。。目前才修复吗 |
We explicitly forbid adding
..toopen_basedirat runtime.Note this is only a minimal fix for the reported issue. There are still problems with
..somewhere in the path, e.g. consider:with index.php:
outputs:
Generally disallowing
..in the path might by too much of a BC break, though.