Loading .htaccess +1 −1 Original line number Diff line number Diff line Loading @@ -3,7 +3,7 @@ # # Protect files and directories from prying eyes. <FilesMatch "\.(engine|inc|install|make|module|profile|po|sh|.*sql|theme|twig|tpl(\.php)?|xtmpl|yml)(~|\.sw[op]|\.bak|\.orig|\.save)?$|^(\.(?!well-known).*|Entries.*|Repository|Root|Tag|Template|composer\.(json|lock))$|^#.*#$|\.php(~|\.sw[op]|\.bak|\.orig|\.save)$"> <FilesMatch "\.(engine|inc|install|make|module|profile|po|sh|.*sql|theme|twig|tpl(\.php)?|xtmpl|yml)(~|\.sw[op]|\.bak|\.orig|\.save)?$|^(\.(?!well-known).*|Entries.*|Repository|Root|Tag|Template|composer\.(json|lock)|web\.config)$|^#.*#$|\.php(~|\.sw[op]|\.bak|\.orig|\.save)$"> <IfModule mod_authz_core.c> Require all denied </IfModule> Loading core/modules/system/tests/fixtures/HtaccessTest/.htaccess 0 → 100644 +0 −0 Empty file added. core/modules/system/tests/fixtures/HtaccessTest/web.config 0 → 100644 +0 −0 Empty file added. core/modules/system/tests/src/Functional/System/HtaccessTest.php +4 −0 Original line number Diff line number Diff line Loading @@ -86,6 +86,10 @@ protected function getProtectedFiles() { $file_paths["$path/composer.json"] = 403; $file_paths["$path/composer.lock"] = 403; // Ensure web server configuration files cannot be accessed. $file_paths["$path/.htaccess"] = 403; $file_paths["$path/web.config"] = 403; return $file_paths; } Loading web.config +1 −1 Original line number Diff line number Diff line Loading @@ -22,7 +22,7 @@ <rewrite> <rules> <rule name="Protect files and directories from prying eyes" stopProcessing="true"> <match url="\.(engine|inc|install|module|profile|po|sh|.*sql|theme|twig|tpl(\.php)?|xtmpl|yml|svn-base)$|^(code-style\.pl|Entries.*|Repository|Root|Tag|Template|all-wcprops|entries|format|composer\.(json|lock))$" /> <match url="\.(engine|inc|install|module|profile|po|sh|.*sql|theme|twig|tpl(\.php)?|xtmpl|yml|svn-base)$|^(code-style\.pl|Entries.*|Repository|Root|Tag|Template|all-wcprops|entries|format|composer\.(json|lock)|\.htaccess)$" /> <action type="CustomResponse" statusCode="403" subStatusCode="0" statusReason="Forbidden" statusDescription="Access is forbidden." /> </rule> Loading Loading
.htaccess +1 −1 Original line number Diff line number Diff line Loading @@ -3,7 +3,7 @@ # # Protect files and directories from prying eyes. <FilesMatch "\.(engine|inc|install|make|module|profile|po|sh|.*sql|theme|twig|tpl(\.php)?|xtmpl|yml)(~|\.sw[op]|\.bak|\.orig|\.save)?$|^(\.(?!well-known).*|Entries.*|Repository|Root|Tag|Template|composer\.(json|lock))$|^#.*#$|\.php(~|\.sw[op]|\.bak|\.orig|\.save)$"> <FilesMatch "\.(engine|inc|install|make|module|profile|po|sh|.*sql|theme|twig|tpl(\.php)?|xtmpl|yml)(~|\.sw[op]|\.bak|\.orig|\.save)?$|^(\.(?!well-known).*|Entries.*|Repository|Root|Tag|Template|composer\.(json|lock)|web\.config)$|^#.*#$|\.php(~|\.sw[op]|\.bak|\.orig|\.save)$"> <IfModule mod_authz_core.c> Require all denied </IfModule> Loading
core/modules/system/tests/src/Functional/System/HtaccessTest.php +4 −0 Original line number Diff line number Diff line Loading @@ -86,6 +86,10 @@ protected function getProtectedFiles() { $file_paths["$path/composer.json"] = 403; $file_paths["$path/composer.lock"] = 403; // Ensure web server configuration files cannot be accessed. $file_paths["$path/.htaccess"] = 403; $file_paths["$path/web.config"] = 403; return $file_paths; } Loading
web.config +1 −1 Original line number Diff line number Diff line Loading @@ -22,7 +22,7 @@ <rewrite> <rules> <rule name="Protect files and directories from prying eyes" stopProcessing="true"> <match url="\.(engine|inc|install|module|profile|po|sh|.*sql|theme|twig|tpl(\.php)?|xtmpl|yml|svn-base)$|^(code-style\.pl|Entries.*|Repository|Root|Tag|Template|all-wcprops|entries|format|composer\.(json|lock))$" /> <match url="\.(engine|inc|install|module|profile|po|sh|.*sql|theme|twig|tpl(\.php)?|xtmpl|yml|svn-base)$|^(code-style\.pl|Entries.*|Repository|Root|Tag|Template|all-wcprops|entries|format|composer\.(json|lock)|\.htaccess)$" /> <action type="CustomResponse" statusCode="403" subStatusCode="0" statusReason="Forbidden" statusDescription="Access is forbidden." /> </rule> Loading