diff --git a/core/modules/page_cache/page_cache.module b/core/modules/page_cache/page_cache.module
index bce166d..4556d36 100644
--- a/core/modules/page_cache/page_cache.module
+++ b/core/modules/page_cache/page_cache.module
@@ -5,8 +5,6 @@
  * Caches responses for anonymous users, request and response policies allowing.
  */
 
-use Drupal\Core\Form\FormStateInterface;
-use Drupal\Core\PageCache\RequestPolicyInterface;
 use Drupal\Core\Routing\RouteMatchInterface;
 
 /**
@@ -29,18 +27,3 @@ function page_cache_help($route_name, RouteMatchInterface $route_match) {
       return $output;
   }
 }
-
-/**
- * Implements hook_form_alter().
- */
-function page_cache_form_alter(&$form, FormStateInterface $form_state, $form_id) {
-  // If the page that's being built is cacheable, set the 'immutable' flag, to
-  // ensure that when the form is used, a new form build ID is generated when
-  // appropriate, to prevent information disclosure.
-  $request_policy = \Drupal::service('page_cache_request_policy');
-  $request = \Drupal::requestStack()->getCurrentRequest();
-  $request_is_cacheable = $request_policy->check($request) === RequestPolicyInterface::ALLOW;
-  if ($request_is_cacheable) {
-    $form_state->addBuildInfo('immutable', TRUE);
-  }
-}
diff --git a/core/modules/system/system.module b/core/modules/system/system.module
index a82353d..fc73580 100644
--- a/core/modules/system/system.module
+++ b/core/modules/system/system.module
@@ -12,6 +12,7 @@
 use Drupal\Core\Extension\ExtensionDiscovery;
 use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\KeyValueStore\KeyValueDatabaseExpirableFactory;
+use Drupal\Core\PageCache\RequestPolicyInterface;
 use Drupal\Core\Routing\RouteMatchInterface;
 use Drupal\Core\Language\LanguageInterface;
 use Drupal\Core\Menu\MenuTreeParameters;
@@ -681,6 +682,21 @@ function system_js_settings_alter(&$settings, AttachedAssetsInterface $assets) {
 }
 
 /**
+ * Implements hook_form_alter().
+ */
+function system_form_alter(&$form, FormStateInterface $form_state, $form_id) {
+  // If the page that's being built is cacheable, set the 'immutable' flag, to
+  // ensure that when the form is used, a new form build ID is generated when
+  // appropriate, to prevent information disclosure.
+  $request_policy = \Drupal::service('page_cache_request_policy');
+  $request = \Drupal::requestStack()->getCurrentRequest();
+  $request_is_cacheable = $request_policy->check($request) === RequestPolicyInterface::ALLOW;
+  if ($request_is_cacheable) {
+    $form_state->addBuildInfo('immutable', TRUE);
+  }
+}
+
+/**
  * Implements hook_form_FORM_ID_alter().
  */
 function system_form_user_form_alter(&$form, FormStateInterface $form_state) {
