note 127628 added to ini.core
| From: | bohwaz at main dot php dot net | Date: | Wed, 14 Sep 2022 21:06:38 +0000 |
| Subject: | note 127628 added to ini.core | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-219572@lists.php.net to get a copy of this message | ||
Please be advised that setting a large post_max_size or upload_max_filesize for a complete server or
a complete virtual host is not a good idea as it may lead to increased security risks.
The risk is that an attacker may send very large POST requests and overloading your server memory
and CPU as it has to parse and process those requests before handling them to your PHP script.
So it's best to limit changing this setting to some files or directories. For example if I want
to /admin/files/ and /admin/images/ I can use:
<If "%{REQUEST_URI} =~ m!^/admin/(files|images)/! && -n %{HTTP_COOKIE}">
php_value post_max_size 256M
php_value upload_max_filesize 256M
</If>
I also require the request to have a cookie to avoid basic attacks. This will not protect you
against attacks coming from non-authenticated users, but may delay any attack.
This setting can be used in Apache server configuration files, and .htaccess files as well.
----
Server IP: 45.112.84.4
Probable Submitter: 185.85.3.173 (proxied: 93.23.199.69)
----
Manual Page -- https://php.net/manual/en/ini.core.php
Edit -- https://main.php.net/note/edit/127628
Del: integrated -- https://main.php.net/note/delete/127628/integrated
Del: useless -- https://main.php.net/note/delete/127628/useless
Del: bad code -- https://main.php.net/note/delete/127628/bad+code
Del: spam -- https://main.php.net/note/delete/127628/spam
Del: non-english -- https://main.php.net/note/delete/127628/non-english
Del: in docs -- https://main.php.net/note/delete/127628/in+docs
Del: other reasons-- https://main.php.net/note/delete/127628
Reject -- https://main.php.net/note/reject/127628
Search -- https://main.php.net/manage/user-notes.php