diff --git a/.htaccess b/.htaccess index cf54b9b8c21..116acf42fb3 100644 --- a/.htaccess +++ b/.htaccess @@ -3,7 +3,7 @@ # # Protect files and directories from prying eyes. - + Require all denied diff --git a/core/assets/scaffold/files/htaccess b/core/assets/scaffold/files/htaccess index cf54b9b8c21..116acf42fb3 100644 --- a/core/assets/scaffold/files/htaccess +++ b/core/assets/scaffold/files/htaccess @@ -3,7 +3,7 @@ # # Protect files and directories from prying eyes. - + Require all denied diff --git a/core/modules/system/tests/fixtures/HtaccessTest/package.json b/core/modules/system/tests/fixtures/HtaccessTest/package.json new file mode 100644 index 00000000000..e69de29bb2d diff --git a/core/modules/system/tests/fixtures/HtaccessTest/yarn.lock b/core/modules/system/tests/fixtures/HtaccessTest/yarn.lock new file mode 100644 index 00000000000..e69de29bb2d diff --git a/core/modules/system/tests/src/Functional/System/HtaccessTest.php b/core/modules/system/tests/src/Functional/System/HtaccessTest.php index e932fa3b348..09046c446fc 100644 --- a/core/modules/system/tests/src/Functional/System/HtaccessTest.php +++ b/core/modules/system/tests/src/Functional/System/HtaccessTest.php @@ -91,6 +91,10 @@ class HtaccessTest extends BrowserTestBase { $file_paths["$path/composer.json"] = 403; $file_paths["$path/composer.lock"] = 403; + // Ensure package.json and yarn.lock cannot be accessed. + $file_paths["$path/package.json"] = 403; + $file_paths["$path/yarn.lock"] = 403; + // Ensure web server configuration files cannot be accessed. $file_paths["$path/.htaccess"] = 403; $file_paths["$path/web.config"] = 403;