diff --git a/typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php b/typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php
index 370f1f70b9ebb8343c85fbc2cdd0bbcb19694a33..860835db40e8e1bbe69b46a3f293e60d23ba85d8 100644
--- a/typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php
+++ b/typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php
@@ -2591,6 +2591,7 @@ class TypoScriptFrontendController implements LoggerAwareInterface
             $this->set_no_cache('config.no_cache is set');
         }
         // Merge GET with defaultGetVars
+        // Please note that this code will get removed in TYPO3 v10.0 as it is done in the PSR-15 middleware.
         if (!empty($this->config['config']['defaultGetVars.'])) {
             $modifiedGetVars = GeneralUtility::removeDotsFromTS($this->config['config']['defaultGetVars.']);
             ArrayUtility::mergeRecursiveWithOverrule($modifiedGetVars, GeneralUtility::_GET());
diff --git a/typo3/sysext/frontend/Classes/Middleware/PrepareTypoScriptFrontendRendering.php b/typo3/sysext/frontend/Classes/Middleware/PrepareTypoScriptFrontendRendering.php
index dd57e6ce25300fd9514bf8c45f2fd94566d0aad5..ff6388a93a1c69dbd5e44354881f014c1278a434 100644
--- a/typo3/sysext/frontend/Classes/Middleware/PrepareTypoScriptFrontendRendering.php
+++ b/typo3/sysext/frontend/Classes/Middleware/PrepareTypoScriptFrontendRendering.php
@@ -21,6 +21,7 @@ use Psr\Http\Message\ServerRequestInterface;
 use Psr\Http\Server\MiddlewareInterface;
 use Psr\Http\Server\RequestHandlerInterface as PsrRequestHandlerInterface;
 use TYPO3\CMS\Core\TimeTracker\TimeTracker;
+use TYPO3\CMS\Core\Utility\ArrayUtility;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController;
 
@@ -64,6 +65,19 @@ class PrepareTypoScriptFrontendRendering implements MiddlewareInterface
         // Get config if not already gotten
         // After this, we should have a valid config-array ready
         $this->controller->getConfigArray();
+
+        // Merge Query Parameters with config.defaultGetVars
+        // This is done in getConfigArray as well, but does not override the current middleware request object
+        // Since we want to stay in sync with this, the option needs to be set as well.
+        if (!empty($this->controller->config['config']['defaultGetVars.'] ?? null)) {
+            $modifiedGetVars = GeneralUtility::removeDotsFromTS($this->controller->config['config']['defaultGetVars.']);
+            if (!empty($request->getQueryParams())) {
+                ArrayUtility::mergeRecursiveWithOverrule($modifiedGetVars, $request->getQueryParams());
+            }
+            $request = $request->withQueryParams($modifiedGetVars);
+            $GLOBALS['TYPO3_REQUEST'] = $request;
+        }
+
         // Setting language and locale
         $this->timeTracker->push('Setting language and locale');
         $this->controller->settingLanguage();