-
Notifications
You must be signed in to change notification settings - Fork 444
Being able to edit @phpFiles matcher in php_server directive #2325
Copy link
Copy link
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Describe your feature request
Is your feature request related to a problem? Please describe.
We had some security issues where a user can upload a php file and execute it using our webserver.
In our old setups (with apache & php-fpm) we used to deny those executions using .htaccess files which ofcourse do not work in caddy.
Describe the solution you'd like
In the docs there is a Section (Using the php_server directive is equivalent to this configuration:) that describes how the php_server directive works.
In there you can find a @phpFiles matcher.
Would it be possible to define this matcher via an option in the php_server directive that defaults to *.php.
I imagined something like this:
php_server {
try_files {path} index.php
php_files "/index.php"
}Describe alternatives you've considered
- Disable the upload from php files:
- would not really achieve the same goal but block the security thread (for now)
- Create a matcher that serves a 403 page for every other php file
- would work but again Frankenphp itself would still be able to execute any php files that does not match the matcher (if configured wrong)
- don't use the
php_serverdirective and copy the snippet from the docs and edit it
- would work but other users would not benefit from this approach
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request