Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backport] Secure errors directory #21946

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion nginx.conf.sample
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,11 @@ location /media/downloadable/ {
location /media/import/ {
deny all;
}
location /errors/ {
location ~* \.xml$ {
deny all;
}
}

# PHP entry point for main application
location ~ ^/(index|get|static|errors/report|errors/404|errors/503|health_check)\.php$ {
Expand Down Expand Up @@ -198,6 +203,6 @@ gzip_types
gzip_vary on;

# Banned locations (only reached if the earlier PHP entry point regexes don't match)
location ~* (\.php$|\.htaccess$|\.git) {
location ~* (\.php$|\.phtml$|\.htaccess$|\.git) {
deny all;
}
3 changes: 3 additions & 0 deletions pub/errors/.htaccess
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
Options None
<FilesMatch "\.(xml|phtml)$">
Deny from all
</FilesMatch>
<IfModule mod_rewrite.c>
RewriteEngine Off
</IfModule>