diff -Nuar a/vendor/magento/framework/Setup/FilePermissions.php b/vendor/magento/framework/Setup/FilePermissions.php
--- a/vendor/magento/framework/Setup/FilePermissions.php
+++ b/vendor/magento/framework/Setup/FilePermissions.php
@@ -137,6 +137,7 @@ class FilePermissions
      */
     private function checkRecursiveDirectories($directory)
     {
+        /** @var $directoryIterator \RecursiveIteratorIterator   */
         $directoryIterator = new \RecursiveIteratorIterator(
             new \RecursiveDirectoryIterator($directory, \RecursiveDirectoryIterator::SKIP_DOTS),
             \RecursiveIteratorIterator::CHILD_FIRST
@@ -155,6 +156,8 @@ class FilePermissions
             ]
         );
 
+        $directoryIterator->setMaxDepth(1);
+
         $foundNonWritable = false;
 
         try {
