diff --git a/core/lib/Drupal/Core/DrupalKernel.php b/core/lib/Drupal/Core/DrupalKernel.php
index 0160119..884f16b 100644
--- a/core/lib/Drupal/Core/DrupalKernel.php
+++ b/core/lib/Drupal/Core/DrupalKernel.php
@@ -203,7 +203,6 @@ public function getContainer() {
    * {@inheritdoc}
    */
   public function discoverServiceProviders() {
-    $this->configStorage = BootstrapConfigStorageFactory::get();
     $serviceProviders = array(
       'CoreServiceProvider' => new CoreServiceProvider(),
     );
@@ -215,7 +214,7 @@ public function discoverServiceProviders() {
     // Ensure we know what modules are enabled and that their namespaces are
     // registered.
     if (!isset($this->moduleList)) {
-      $module_list = $this->configStorage->read('system.module');
+      $module_list = $this->getConfigStorage()->read('system.module');
       $this->moduleList = isset($module_list['enabled']) ? $module_list['enabled'] : array();
     }
     $module_filenames = $this->getModuleFileNames();
@@ -301,7 +300,7 @@ protected function moduleData($module) {
       $profiles = array_keys(array_intersect_key($this->moduleList, $all_profiles));
       // If a module is within a profile directory but specifies another
       // profile for testing, it needs to be found in the parent profile.
-      if (($parent_profile_config = $this->configStorage->read('simpletest.settings')) && isset($parent_profile_config['parent_profile']) && $parent_profile_config['parent_profile'] != $profiles[0]) {
+      if (($parent_profile_config = $this->getConfigStorage()->read('simpletest.settings')) && isset($parent_profile_config['parent_profile']) && $parent_profile_config['parent_profile'] != $profiles[0]) {
         // In case both profile directories contain the same extension, the
         // actual profile always has precedence.
         array_unshift($profiles, $parent_profile_config['parent_profile']);
@@ -416,7 +415,15 @@ protected function initializeContainer() {
 
       // If 'container.modules' is wrong, the container must be rebuilt.
       if (!isset($this->moduleList)) {
-        $this->moduleList = $this->container->get('config.factory')->get('system.module')->load()->get('enabled');
+        // The default config factory/storage is cached; if the system.module
+        // configuration was manually updated in order to e.g. remove a faulty
+        // module, then the previously cached system.module configuration would
+        // be returned here, causing DrupalKernel to continuously rebuild the
+        // container on every single page request, even when using the rebuild
+        // script.
+        $this->configStorage = BootstrapConfigStorageFactory::get();
+        $this->moduleList = $this->configStorage->read('system.module');
+        $this->moduleList = !empty($this->moduleList['enabled']) ? $this->moduleList['enabled'] : array();
       }
       if (array_keys($this->moduleList) !== array_keys($container_modules)) {
         $persist = $this->getServicesToPersist();
@@ -663,4 +670,14 @@ protected function registerNamespaces(array $namespaces = array()) {
       $this->classLoader->add($prefix, $path);
     }
   }
+
+  /**
+   * Returns the config storage.
+   */
+  protected function getConfigStorage() {
+    if (!isset($this->configStorage)) {
+      $this->configStorage = BootstrapConfigStorageFactory::get();
+    }
+    return $this->configStorage;
+  }
 }
