Re: Re: [RFC][VOTE] Introduce script only include/require
| From: | Stanislav Malyshev | Date: | Thu, 26 Feb 2015 08:51:26 +0000 |
| Subject: | Re: Re: [RFC][VOTE] Introduce script only include/require | ||
| References: | 1 2 3 4 5 6 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-83875@lists.php.net to get a copy of this message | ||
Hi!
> This can be prevented by restricting phar archive name or forbid all
> URI name at all. The latter is better choice.
If by "all uri" you mean all streams, that would be very high burden,
which may break many applications using streams, including phar handling.
> There is design problem obviously. The reason why phar:// is allowed is
> that "allow_url_include" is not INI_ALL.
The reason why phar is allowed is because phar is not a remote stream,
so access to phar is the same as access to local file system, which is
necessary for include anyway. The contents of phar is in the same domain
as contents of local filesystem, that's why no distinction is made.
> Script cannot change the setting, therefore special phar:// is needed to
> be allowed unconditionally. I would say INI_SYSTEM for allow_url_include
> is false sense of security. It introduced security issue like you've
> mentioned.
It doesn't introduce any issues, unless you declare there should be
distinction between files on the filesystem, which is needed to make
your approach useful. But I do not think it's a good security - trying
to allow including user-controlled files securely is IMO a futile task.
The problem should be fixed at the root - by not having such includes
that allow arbitrary filenames injected by user.
--
Stas Malyshev
smalyshev@gmail.com