Skip to content

Commit

Permalink
Merge pull request from GHSA-mj6m-246h-9w56
Browse files Browse the repository at this point in the history
* only allow access to specific PHP files in their specific location

* same change is needed in .htaccess file scaffolded in mautic/core-lib

* improved wording in comments

Co-authored-by: Ruth Cheesley <ruth.cheesley@acquia.com>

* loosened regex to allow index_dev.php requests

Co-authored-by: Ruth Cheesley <ruth.cheesley@acquia.com>
  • Loading branch information
mollux and RCheesley committed Feb 28, 2022
1 parent cabfb2a commit cd998bd
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 13 deletions.
12 changes: 6 additions & 6 deletions .htaccess
Expand Up @@ -109,10 +109,10 @@
Require all denied
</FilesMatch>

# Except those whitelisted bellow.
<FilesMatch "^(index|index_dev|filemanager|upgrade)\.php$">
# Except those allowed below.
<If "%{REQUEST_URI} =~ m#^/(index|index_dev|upgrade/upgrade)\.php#">
Require all granted
</FilesMatch>
</If>
</IfModule>

# Fallback for Apache < 2.4
Expand All @@ -129,10 +129,10 @@
Deny from all
</FilesMatch>

# Except those whitelisted bellow.
<FilesMatch "^(index|index_dev|filemanager|upgrade)\.php$">
# Except those allowed below.
<If "%{REQUEST_URI} =~ m#^/(index|index_dev|upgrade/upgrade)\.php#">
Order allow,deny
Allow from all
</FilesMatch>
</If>
</IfModule>

13 changes: 6 additions & 7 deletions app/assets/scaffold/files/htaccess
Expand Up @@ -109,10 +109,10 @@
Require all denied
</FilesMatch>

# Except those whitelisted bellow.
<FilesMatch "^(index|index_dev|filemanager|upgrade)\.php$">
# Except those allowed below.
<If "%{REQUEST_URI} =~ m#^/(index|index_dev|upgrade/upgrade)\.php#">
Require all granted
</FilesMatch>
</If>
</IfModule>

# Fallback for Apache < 2.4
Expand All @@ -129,10 +129,9 @@
Deny from all
</FilesMatch>

# Except those whitelisted bellow.
<FilesMatch "^(index|index_dev|filemanager|upgrade)\.php$">
# Except those allowed below.
<If "%{REQUEST_URI} =~ m#^/(index|index_dev|upgrade/upgrade)\.php#">
Order allow,deny
Allow from all
</FilesMatch>
</If>
</IfModule>

0 comments on commit cd998bd

Please sign in to comment.