Re: Re: Common-sense security hardening for the next PHP
| From: | Casper Langemeijer | Date: | Thu, 19 Nov 2026 19:48:28 +0000 |
| Subject: | Re: Re: Common-sense security hardening for the next PHP | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-133128@lists.php.net to get a copy of this message | ||
On Thu, Nov 19, 2026, at 18:52, Gregory Magarshak wrote:
> 1) Make it so that include() and require() can only load specific extensions like
> ".php" and ".phar"
> 2) At the same time, all file functions that write to a file (e.g. fwrite and
> file_put_contents) must refuse to write to exactly these extensions.
Not a very good idea, since this would break almost all template engines, like Twig, Blade, etc.
They depend on compiling templates to php code for speed.
Grtz, Casper