diff --git a/core/modules/system/lib/Drupal/system/Plugin/Block/SystemHelpBlock.php b/core/modules/system/lib/Drupal/system/Plugin/Block/SystemHelpBlock.php
index f7b389d..9070eff 100644
--- a/core/modules/system/lib/Drupal/system/Plugin/Block/SystemHelpBlock.php
+++ b/core/modules/system/lib/Drupal/system/Plugin/Block/SystemHelpBlock.php
@@ -94,7 +94,7 @@ protected function getActiveHelp(Request $request) {
     $output = '';
     $router_path = $request->attributes->get('_system_path');
     // We will always have a path unless we are on a 403 or 404.
-    if (!$router_path) {
+    if (!$router_path || !drupal_valid_path($router_path)) {
       return '';
     }
 
