{
    "document": {
        "category": "csaf_base",
        "csaf_version": "2.0",
        "distribution": {
            "tlp": {
                "label": "WHITE"
            }
        },
        "lang": "en",
        "notes": [
            {
                "category": "legal_disclaimer",
                "text": "The Netherlands Cyber Security Center (henceforth: NCSC-NL) maintains this portal to enhance access to its information and vulnerabilities. The use of this information is subject to the following terms and conditions:\n\nThe vulnerabilities disclosed in this portal are gathered by NCSC-NL from a variety of open sources, which the user can retrieve from other platforms. NCSC-NL makes every reasonable effort to ensure that the content of this portal is kept up to date, and that it is accurate and complete. Nevertheless, NCSC-NL cannot entirely rule out the possibility of errors, and therefore cannot give any warranty in respect of its completeness, accuracy or real-time keeping up-to-date. NCSC-NL does not control nor guarantee the accuracy, relevance, timeliness or completeness of information obtained from these external sources. The vulnerabilities disclosed in this portal are intended solely for the convenience of professional parties to take appropriate measures to manage the risks posed to the cybersecurity. No rights can be derived from the information provided therein.\n\nNCSC-NL and the Kingdom of the Netherlands assume no legal liability or responsibility for any damage resulting from either the use or inability of use of the vulnerabilities disclosed in this portal. This includes damage resulting from the inaccuracy of incompleteness of the information contained in it.\nThe information on this page is subject to Dutch law. All disputes related to or arising from the use of this portal regarding the disclosure of vulnerabilities will be submitted to the competent court in The Hague. This choice of means also applies to the court in summary proceedings."
            }
        ],
        "publisher": {
            "category": "coordinator",
            "contact_details": "cert@ncsc.nl",
            "name": "National Cyber Security Centre",
            "namespace": "https://www.ncsc.nl/"
        },
        "title": "CVE-2026-31819",
        "tracking": {
            "current_release_date": "2026-03-20T09:32:50.059736Z",
            "generator": {
                "date": "2026-02-17T15:00:00Z",
                "engine": {
                    "name": "V.E.L.M.A",
                    "version": "1.7"
                }
            },
            "id": "CVE-2026-31819",
            "initial_release_date": "2026-03-10T21:40:00.458070Z",
            "revision_history": [
                {
                    "date": "2026-03-10T21:40:00.458070Z",
                    "number": "1",
                    "summary": "CVE created.| Source created.| CVE status created. (valid)| Description created for source.| CVSS created.| Products connected (3).| Products created (6).| References created (1).| CWES updated (1)."
                },
                {
                    "date": "2026-03-10T21:40:03.654019Z",
                    "number": "2",
                    "summary": "NCSC Score created."
                },
                {
                    "date": "2026-03-10T22:25:58.214010Z",
                    "number": "3",
                    "summary": "Source created.| CVE status created. (valid)| Description created for source.| CVSS created.| References created (1).| CWES updated (1)."
                },
                {
                    "date": "2026-03-10T22:26:01.174367Z",
                    "number": "4",
                    "summary": "NCSC Score updated."
                },
                {
                    "date": "2026-03-11T00:53:23.576819Z",
                    "number": "5",
                    "summary": "Source created.| CVE status created. (valid)| Description created for source.| CVSS created.| References created (2).| CWES updated (1)."
                },
                {
                    "date": "2026-03-11T00:53:26.861994Z",
                    "number": "6",
                    "summary": "NCSC Score updated."
                },
                {
                    "date": "2026-03-11T14:54:34.649488Z",
                    "number": "7",
                    "summary": "Source created.| CVE status created. (valid)| EPSS created."
                },
                {
                    "date": "2026-03-11T14:54:40.522348Z",
                    "number": "8",
                    "summary": "NCSC Score updated."
                },
                {
                    "date": "2026-03-11T16:39:32.081707Z",
                    "number": "9",
                    "summary": "Unknown change."
                },
                {
                    "date": "2026-03-11T20:25:54.016830Z",
                    "number": "10",
                    "summary": "CVSS created.| Products connected (9).| Product Identifiers created (9)."
                },
                {
                    "date": "2026-03-11T20:26:02.433501Z",
                    "number": "11",
                    "summary": "NCSC Score updated."
                },
                {
                    "date": "2026-03-11T20:40:58.046011Z",
                    "number": "12",
                    "summary": "Description removed for source.| Description created for source.| References created (1)."
                },
                {
                    "date": "2026-03-19T15:29:43.751909Z",
                    "number": "13",
                    "summary": "Source created.| CVE status created. (valid)| Description created for source.| CVSS created.| References created (3).| CWES updated (1)."
                },
                {
                    "date": "2026-03-19T15:29:46.200313Z",
                    "number": "14",
                    "summary": "NCSC Score updated."
                },
                {
                    "date": "2026-03-20T09:32:48.766130Z",
                    "number": "15",
                    "summary": "Source connected.| CVE status created. (valid)| EPSS created."
                }
            ],
            "status": "interim",
            "version": "15"
        }
    },
    "product_tree": {
        "branches": [
            {
                "branches": [
                    {
                        "branches": [
                            {
                                "category": "product_version_range",
                                "name": "vers:unknown/<1.9.12",
                                "product": {
                                    "name": "vers:unknown/<1.9.12",
                                    "product_id": "CSAFPID-5778750",
                                    "product_identification_helper": {
                                        "cpe": "cpe:2.3:a:sylius:sylius:*:*:*:*:*:*:*:*"
                                    }
                                }
                            },
                            {
                                "category": "product_version_range",
                                "name": "vers:unknown/>=1.10.0|<1.10.16",
                                "product": {
                                    "name": "vers:unknown/>=1.10.0|<1.10.16",
                                    "product_id": "CSAFPID-5778749",
                                    "product_identification_helper": {
                                        "cpe": "cpe:2.3:a:sylius:sylius:*:*:*:*:*:*:*:*"
                                    }
                                }
                            },
                            {
                                "category": "product_version_range",
                                "name": "vers:unknown/>=1.11.0|<1.11.17",
                                "product": {
                                    "name": "vers:unknown/>=1.11.0|<1.11.17",
                                    "product_id": "CSAFPID-5778748",
                                    "product_identification_helper": {
                                        "cpe": "cpe:2.3:a:sylius:sylius:*:*:*:*:*:*:*:*"
                                    }
                                }
                            },
                            {
                                "category": "product_version_range",
                                "name": "vers:unknown/>=1.12.0|<1.12.23",
                                "product": {
                                    "name": "vers:unknown/>=1.12.0|<1.12.23",
                                    "product_id": "CSAFPID-5778747",
                                    "product_identification_helper": {
                                        "cpe": "cpe:2.3:a:sylius:sylius:*:*:*:*:*:*:*:*"
                                    }
                                }
                            },
                            {
                                "category": "product_version_range",
                                "name": "vers:unknown/>=1.13.0|<1.13.15",
                                "product": {
                                    "name": "vers:unknown/>=1.13.0|<1.13.15",
                                    "product_id": "CSAFPID-5778746",
                                    "product_identification_helper": {
                                        "cpe": "cpe:2.3:a:sylius:sylius:*:*:*:*:*:*:*:*"
                                    }
                                }
                            },
                            {
                                "category": "product_version_range",
                                "name": "vers:unknown/>=1.14.0|<1.14.18",
                                "product": {
                                    "name": "vers:unknown/>=1.14.0|<1.14.18",
                                    "product_id": "CSAFPID-5778745",
                                    "product_identification_helper": {
                                        "cpe": "cpe:2.3:a:sylius:sylius:*:*:*:*:*:*:*:*"
                                    }
                                }
                            },
                            {
                                "category": "product_version_range",
                                "name": "vers:unknown/>=2.0.0|<2.0.16",
                                "product": {
                                    "name": "vers:unknown/>=2.0.0|<2.0.16",
                                    "product_id": "CSAFPID-5778702",
                                    "product_identification_helper": {
                                        "cpe": "cpe:2.3:a:sylius:sylius:*:*:*:*:*:*:*:*"
                                    }
                                }
                            },
                            {
                                "category": "product_version_range",
                                "name": "vers:unknown/>=2.1.0|<2.1.12",
                                "product": {
                                    "name": "vers:unknown/>=2.1.0|<2.1.12",
                                    "product_id": "CSAFPID-5778701",
                                    "product_identification_helper": {
                                        "cpe": "cpe:2.3:a:sylius:sylius:*:*:*:*:*:*:*:*"
                                    }
                                }
                            },
                            {
                                "category": "product_version_range",
                                "name": "vers:unknown/>=2.2.0|<2.2.3",
                                "product": {
                                    "name": "vers:unknown/>=2.2.0|<2.2.3",
                                    "product_id": "CSAFPID-5778700",
                                    "product_identification_helper": {
                                        "cpe": "cpe:2.3:a:sylius:sylius:*:*:*:*:*:*:*:*"
                                    }
                                }
                            }
                        ],
                        "category": "product_name",
                        "name": "Sylius"
                    }
                ],
                "category": "vendor",
                "name": "Sylius"
            }
        ]
    },
    "vulnerabilities": [
        {
            "cve": "CVE-2026-31819",
            "cwe": {
                "id": "CWE-601",
                "name": "URL Redirection to Untrusted Site ('Open Redirect')"
            },
            "notes": [
                {
                    "category": "description",
                    "text": "### Impact\n`CurrencySwitchController::switchAction()`, `ImpersonateUserController::impersonateAction()` and `StorageBasedLocaleSwitcher::handle()` use the HTTP Referer header directly when redirecting.\n\nThe attack requires the victim to click a legitimate application link placed on an attacker-controlled page. The browser automatically sends the attacker's site as the Referer, and the application redirects back to it. This can be used for phishing or credential theft, as the redirect originates from a trusted domain.\n\nThe severity varies by endpoint; public endpoints require no authentication and are trivially exploitable, while admin-only endpoints require an authenticated session but remain vulnerable if an admin follows a link from an external source such as email or chat.\n\nAffected classes:\n- `CurrencySwitchController::switchAction()` - public\n- `StorageBasedLocaleSwitcher::handle()` - public, used in locale switching without having locale in the `url`\n- `ImpersonateUserController::impersonateAction()` - admin-only\n\n### Patches\nThe issue is fixed in versions: 1.9.12, 1.10.16, 1.11.17, 1.12.23, 1.13.15, 1.14.18, 2.0.16, 2.1.12, 2.2.3 and above.\n\n### Workarounds\nIf you cannot update Sylius immediately, copy the affected classes from vendor to your project's `src/` directory, apply the fix, and override the service definitions.\n\n#### Step 1 - CurrencySwitchController\n\nCopy from `vendor/sylius/sylius/src/Sylius/Bundle/ShopBundle/Controller/CurrencySwitchController.php` to `src/Controller/CurrencySwitchController.php` and apply the following changes:\n\n```diff\n-namespace Sylius\\Bundle\\ShopBundle\\Controller;\n+namespace App\\Controller;\n\n use Sylius\\Component\\Channel\\Context\\ChannelContextInterface;\n use Sylius\\Component\\Core\\Currency\\CurrencyStorageInterface;\n use Sylius\\Component\\Core\\Model\\ChannelInterface;\n use Symfony\\Component\\HttpFoundation\\RedirectResponse;\n use Symfony\\Component\\HttpFoundation\\Request;\n use Symfony\\Component\\HttpFoundation\\Response;\n+use Symfony\\Component\\Routing\\RouterInterface;\n\n final class CurrencySwitchController\n {\n     public function __construct(\n         private Environment $templatingEngine, // for 1.x version\n         private CurrencyStorageInterface $currencyStorage,\n         private ChannelContextInterface $channelContext,\n+        private RouterInterface $router,\n     ) {\n     }\n\n     public function switchAction(Request $request, string $code): Response\n     {\n         /** @var ChannelInterface $channel */\n         $channel = $this->channelContext->getChannel();\n\n         $this->currencyStorage->set($channel, $code);\n\n-        return new RedirectResponse($request->headers->get('referer', $request->getSchemeAndHttpHost()));\n+        return new RedirectResponse($this->router->generate('sylius_shop_homepage'));\n     }\n }\n```\n\n#### Step 2 - ImpersonateUserController\n\nCopy from `vendor/sylius/sylius/src/Sylius/Bundle/AdminBundle/Controller/ImpersonateUserController.php` to `src/Controller/Admin/ImpersonateUserController.php` and apply the following changes:\n\n```diff\n-namespace Sylius\\Bundle\\AdminBundle\\Controller;\n+namespace App\\Controller\\Admin;\n\n // ... (keep all existing use statements)\n\n     public function impersonateAction(Request $request, string $username): Response\n     {\n         // ... (keep authorization check and impersonation logic)\n\n         $this->addFlash($request, $username);\n\n-        $redirectUrl = $request->headers->get(\n-            'referer',\n+        return new RedirectResponse(\n             $this->router->generate('sylius_admin_customer_show', ['id' => $user->getId()])\n         );\n-\n-        return new RedirectResponse($redirectUrl);\n     }\n```\n\n#### Step 3 - StorageBasedLocaleSwitcher (only if you use `locale_switcher: storage`)\n\n> **Note:** Skip this step if you use the default `locale_switcher: url` mode.\n\nCopy from `vendor/sylius/sylius/src/Sylius/Bundle/ShopBundle/Locale/StorageBasedLocaleSwitcher.php` to `src/Locale/StorageBasedLocaleSwitcher.php` and apply the following changes:\n\n**For Sylius 1.9 – 2.1.2:**\n\n```diff\n-namespace Sylius\\Bundle\\ShopBundle\\Locale;\n+namespace App\\Locale;\n\n use Sylius\\Bundle\\ShopBundle\\Locale\\LocaleSwitcherInterface;\n use Sylius\\Component\\Channel\\Context\\ChannelContextInterface;\n use Sylius\\Component\\Core\\Locale\\LocaleStorageInterface;\n use Symfony\\Component\\HttpFoundation\\RedirectResponse;\n use Symfony\\Component\\HttpFoundation\\Request;\n+use Symfony\\Component\\Routing\\RouterInterface;\n\n final class StorageBasedLocaleSwitcher implements LocaleSwitcherInterface\n {\n     public function __construct(\n         private LocaleStorageInterface $localeStorage,\n         private ChannelContextInterface $channelContext,\n+        private RouterInterface $router,\n     ) {\n     }\n\n     public function handle(Request $request, string $localeCode): RedirectResponse\n     {\n         $this->localeStorage->set($this->channelContext->getChannel(), $localeCode);\n\n-        return new RedirectResponse($request->headers->get('referer', $request->getSchemeAndHttpHost()));\n+        return new RedirectResponse($this->router->generate('sylius_shop_homepage'));\n     }\n }\n```\n\n**For Sylius 2.1.3 and later:**\n\n> In Sylius 2.1.3 the class was refactored to use `UrlMatcherInterface`. While this adds partial validation, it still passes the full referer URL to `RedirectResponse`, so the open redirect remains exploitable.\n\n```diff\n-namespace Sylius\\Bundle\\ShopBundle\\Locale;\n+namespace App\\Locale;\n\n use Sylius\\Bundle\\ShopBundle\\Locale\\LocaleSwitcherInterface;\n use Sylius\\Component\\Channel\\Context\\ChannelContextInterface;\n use Sylius\\Component\\Core\\Locale\\LocaleStorageInterface;\n use Symfony\\Component\\HttpFoundation\\RedirectResponse;\n use Symfony\\Component\\HttpFoundation\\Request;\n-use Symfony\\Component\\Routing\\Exception\\ResourceNotFoundException;\n-use Symfony\\Component\\Routing\\Matcher\\UrlMatcherInterface;\n+use Symfony\\Component\\Routing\\RouterInterface;\n\n final class StorageBasedLocaleSwitcher implements LocaleSwitcherInterface\n {\n     public function __construct(\n         private LocaleStorageInterface $localeStorage,\n         private ChannelContextInterface $channelContext,\n-        private ?UrlMatcherInterface $urlMatcher = null,\n+        private RouterInterface $router,\n     ) {\n-        if (null === $this->urlMatcher) {\n-            trigger_deprecation(\n-                'sylius/shop-bundle',\n-                '2.1',\n-                'Not passing a \"%s\" to \"%s\" is deprecated and will be required in Sylius 3.0.',\n-                UrlMatcherInterface::class,\n-                self::class,\n-            );\n-        }\n     }\n\n     public function handle(Request $request, string $localeCode): RedirectResponse\n     {\n         $this->localeStorage->set($this->channelContext->getChannel(), $localeCode);\n-        $url = $request->headers->get('referer', $request->getSchemeAndHttpHost());\n-\n-        if ($this->urlMatcher) {\n-            try {\n-                $this->urlMatcher->match($url);\n-            } catch (ResourceNotFoundException) {\n-                return new RedirectResponse($request->getSchemeAndHttpHost());\n-            }\n-        }\n-\n-        return new RedirectResponse($url);\n+        return new RedirectResponse($this->router->generate('sylius_shop_homepage'));\n     }\n }\n```\n\n#### Step 4 - Override the services\n\nAdd to `config/services.yaml`.\n\n**Sylius 1.x (1.9 – 1.14):**\n\n```yaml\nservices:\n    # ... your existing services ...\n\n    sylius.controller.shop.currency_switch:\n        class: App\\Controller\\CurrencySwitchController\n        public: true\n        arguments:\n            $templatingEngine: '@twig'\n            $currencyStorage: '@sylius.storage.currency'\n            $channelContext: '@sylius.context.channel'\n            $router: '@router'\n\n    sylius.controller.shop.impersonate_user:\n        class: App\\Controller\\Admin\\ImpersonateUserController\n        public: true\n        arguments:\n            $impersonator: '@sylius.admin.security.user_impersonator'\n            $authorizationChecker: '@security.authorization_checker'\n            $userProvider: '@sylius.admin_user_provider.email_or_name_based'\n            $router: '@router'\n            $authorizationRole: 'ROLE_ADMINISTRATION_ACCESS'\n\n    # Only if you use locale_switcher: storage\n    sylius.shop.locale_switcher:\n        class: App\\Locale\\StorageBasedLocaleSwitcher\n        public: false\n        arguments:\n            $localeStorage: '@sylius.storage.locale'\n            $channelContext: '@sylius.context.channel'\n            $router: '@router'\n```\n\n**Sylius 2.x (2.0 – 2.1):**\n\n```yaml\nservices:\n    # ... your existing services ...\n\n    sylius_shop.controller.currency_switch:\n        class: App\\Controller\\CurrencySwitchController\n        public: true\n        arguments:\n            $currencyStorage: '@sylius.storage.currency'\n            $channelContext: '@sylius.context.channel'\n            $router: '@router'\n\n    sylius_admin.controller.impersonate_user:\n        class: App\\Controller\\Admin\\ImpersonateUserController\n        public: true\n        arguments:\n            $impersonator: '@sylius_admin.security.shop_user_impersonator'\n            $authorizationChecker: '@security.authorization_checker'\n            $userProvider: '@sylius.shop_user_provider.email_or_name_based'\n            $router: '@router'\n            $authorizationRole: 'ROLE_ADMINISTRATION_ACCESS'\n\n    # Only if you use locale_switcher: storage\n    sylius_shop.locale_switcher:\n        class: App\\Locale\\StorageBasedLocaleSwitcher\n        public: false\n        arguments:\n            $localeStorage: '@sylius.storage.locale'\n            $channelContext: '@sylius.context.channel'\n            $router: '@router'\n```\n\n#### Step 5 - Clear cache\n\n```bash\nbin/console cache:clear\n```\n\n---\n\n#### Customizing the redirect target\n\nIf you need a different redirect target, override the route definition with the `_sylius.redirect` attribute:\n\n```yaml\n# config/routes/sylius_shop.yaml (AFTER the sylius_shop resource import)\nsylius_shop_switch_currency:\n    path: /{_locale}/switch-currency/{code}\n    methods: [GET]\n    defaults:\n        _controller: sylius.controller.shop.currency_switch:switchAction\n        _sylius:\n            redirect: sylius_shop_product_index  # or any route name\n```\n\n### Reporters\n\nWe would like to extend our gratitude to the following individuals for their detailed reporting and responsible disclosure of this vulnerability:\n- Bartłomiej Nowiński (@bnBart)\n\n### For more information\n\nIf you have any questions or comments about this advisory:\n\n- Open an issue in [Sylius issues](https://github.com/Sylius/Sylius/issues?q=sort%3Aupdated-desc+is%3Aissue+is%3Aopen)\n- Email us at [security@sylius.com](mailto:security@sylius.com)",
                    "title": "github - https://api.github.com/advisories/GHSA-9ffx-f77r-756w"
                },
                {
                    "category": "description",
                    "text": "Sylius is an Open Source eCommerce Framework on Symfony. CurrencySwitchController::switchAction(), ImpersonateUserController::impersonateAction() and StorageBasedLocaleSwitcher::handle() use the HTTP Referer header directly when redirecting. The attack requires the victim to click a legitimate application link placed on an attacker-controlled page. The browser automatically sends the attacker's site as the Referer, and the application redirects back to it. This can be used for phishing or credential theft, as the redirect originates from a trusted domain. The severity varies by endpoint; public endpoints require no authentication and are trivially exploitable, while admin-only endpoints require an authenticated session but remain vulnerable if an admin follows a link from an external source such as email or chat. The issue is fixed in versions: 1.9.12, 1.10.16, 1.11.17, 1.12.23, 1.13.15, 1.14.18, 2.0.16, 2.1.12, 2.2.3 and above.",
                    "title": "cveprojectv5 - https://www.cve.org/CVERecord?id=CVE-2026-31819"
                },
                {
                    "category": "description",
                    "text": "Sylius is an Open Source eCommerce Framework on Symfony. CurrencySwitchController::switchAction(), ImpersonateUserController::impersonateAction() and StorageBasedLocaleSwitcher::handle() use the HTTP Referer header directly when redirecting. The attack requires the victim to click a legitimate application link placed on an attacker-controlled page. The browser automatically sends the attacker's site as the Referer, and the application redirects back to it. This can be used for phishing or credential theft, as the redirect originates from a trusted domain. The severity varies by endpoint; public endpoints require no authentication and are trivially exploitable, while admin-only endpoints require an authenticated session but remain vulnerable if an admin follows a link from an external source such as email or chat. The issue is fixed in versions: 1.9.12, 1.10.16, 1.11.17, 1.12.23, 1.13.15, 1.14.18, 2.0.16, 2.1.12, 2.2.3 and above.",
                    "title": "nvd - https://nvd.nist.gov/vuln/detail/CVE-2026-31819"
                },
                {
                    "category": "description",
                    "text": "### Impact\n`CurrencySwitchController::switchAction()`, `ImpersonateUserController::impersonateAction()` and `StorageBasedLocaleSwitcher::handle()` use the HTTP Referer header directly when redirecting.\n\nThe attack requires the victim to click a legitimate application link placed on an attacker-controlled page. The browser automatically sends the attacker's site as the Referer, and the application redirects back to it. This can be used for phishing or credential theft, as the redirect originates from a trusted domain.\n\nThe severity varies by endpoint; public endpoints require no authentication and are trivially exploitable, while admin-only endpoints require an authenticated session but remain vulnerable if an admin follows a link from an external source such as email or chat.\n\nAffected classes:\n- `CurrencySwitchController::switchAction()` - public\n- `StorageBasedLocaleSwitcher::handle()` - public, used in locale switching without having locale in the `url`\n- `ImpersonateUserController::impersonateAction()` - admin-only\n\n### Patches\nThe issue is fixed in versions: 1.9.12, 1.10.16, 1.11.17, 1.12.23, 1.13.15, 1.14.18, 2.0.16, 2.1.12, 2.2.3 and above.\n\n### Workarounds\nIf you cannot update Sylius immediately, copy the affected classes from vendor to your project's `src/` directory, apply the fix, and override the service definitions.\n\n#### Step 1 - CurrencySwitchController\n\nCopy from `vendor/sylius/sylius/src/Sylius/Bundle/ShopBundle/Controller/CurrencySwitchController.php` to `src/Controller/CurrencySwitchController.php` and apply the following changes:\n\n```diff\n-namespace Sylius\\Bundle\\ShopBundle\\Controller;\n+namespace App\\Controller;\n\n use Sylius\\Component\\Channel\\Context\\ChannelContextInterface;\n use Sylius\\Component\\Core\\Currency\\CurrencyStorageInterface;\n use Sylius\\Component\\Core\\Model\\ChannelInterface;\n use Symfony\\Component\\HttpFoundation\\RedirectResponse;\n use Symfony\\Component\\HttpFoundation\\Request;\n use Symfony\\Component\\HttpFoundation\\Response;\n+use Symfony\\Component\\Routing\\RouterInterface;\n\n final class CurrencySwitchController\n {\n     public function __construct(\n         private Environment $templatingEngine, // for 1.x version\n         private CurrencyStorageInterface $currencyStorage,\n         private ChannelContextInterface $channelContext,\n+        private RouterInterface $router,\n     ) {\n     }\n\n     public function switchAction(Request $request, string $code): Response\n     {\n         /** @var ChannelInterface $channel */\n         $channel = $this->channelContext->getChannel();\n\n         $this->currencyStorage->set($channel, $code);\n\n-        return new RedirectResponse($request->headers->get('referer', $request->getSchemeAndHttpHost()));\n+        return new RedirectResponse($this->router->generate('sylius_shop_homepage'));\n     }\n }\n```\n\n#### Step 2 - ImpersonateUserController\n\nCopy from `vendor/sylius/sylius/src/Sylius/Bundle/AdminBundle/Controller/ImpersonateUserController.php` to `src/Controller/Admin/ImpersonateUserController.php` and apply the following changes:\n\n```diff\n-namespace Sylius\\Bundle\\AdminBundle\\Controller;\n+namespace App\\Controller\\Admin;\n\n // ... (keep all existing use statements)\n\n     public function impersonateAction(Request $request, string $username): Response\n     {\n         // ... (keep authorization check and impersonation logic)\n\n         $this->addFlash($request, $username);\n\n-        $redirectUrl = $request->headers->get(\n-            'referer',\n+        return new RedirectResponse(\n             $this->router->generate('sylius_admin_customer_show', ['id' => $user->getId()])\n         );\n-\n-        return new RedirectResponse($redirectUrl);\n     }\n```\n\n#### Step 3 - StorageBasedLocaleSwitcher (only if you use `locale_switcher: storage`)\n\n> **Note:** Skip this step if you use the default `locale_switcher: url` mode.\n\nCopy from `vendor/sylius/sylius/src/Sylius/Bundle/ShopBundle/Locale/StorageBasedLocaleSwitcher.php` to `src/Locale/StorageBasedLocaleSwitcher.php` and apply the following changes:\n\n**For Sylius 1.9 – 2.1.2:**\n\n```diff\n-namespace Sylius\\Bundle\\ShopBundle\\Locale;\n+namespace App\\Locale;\n\n use Sylius\\Bundle\\ShopBundle\\Locale\\LocaleSwitcherInterface;\n use Sylius\\Component\\Channel\\Context\\ChannelContextInterface;\n use Sylius\\Component\\Core\\Locale\\LocaleStorageInterface;\n use Symfony\\Component\\HttpFoundation\\RedirectResponse;\n use Symfony\\Component\\HttpFoundation\\Request;\n+use Symfony\\Component\\Routing\\RouterInterface;\n\n final class StorageBasedLocaleSwitcher implements LocaleSwitcherInterface\n {\n     public function __construct(\n         private LocaleStorageInterface $localeStorage,\n         private ChannelContextInterface $channelContext,\n+        private RouterInterface $router,\n     ) {\n     }\n\n     public function handle(Request $request, string $localeCode): RedirectResponse\n     {\n         $this->localeStorage->set($this->channelContext->getChannel(), $localeCode);\n\n-        return new RedirectResponse($request->headers->get('referer', $request->getSchemeAndHttpHost()));\n+        return new RedirectResponse($this->router->generate('sylius_shop_homepage'));\n     }\n }\n```\n\n**For Sylius 2.1.3 and later:**\n\n> In Sylius 2.1.3 the class was refactored to use `UrlMatcherInterface`. While this adds partial validation, it still passes the full referer URL to `RedirectResponse`, so the open redirect remains exploitable.\n\n```diff\n-namespace Sylius\\Bundle\\ShopBundle\\Locale;\n+namespace App\\Locale;\n\n use Sylius\\Bundle\\ShopBundle\\Locale\\LocaleSwitcherInterface;\n use Sylius\\Component\\Channel\\Context\\ChannelContextInterface;\n use Sylius\\Component\\Core\\Locale\\LocaleStorageInterface;\n use Symfony\\Component\\HttpFoundation\\RedirectResponse;\n use Symfony\\Component\\HttpFoundation\\Request;\n-use Symfony\\Component\\Routing\\Exception\\ResourceNotFoundException;\n-use Symfony\\Component\\Routing\\Matcher\\UrlMatcherInterface;\n+use Symfony\\Component\\Routing\\RouterInterface;\n\n final class StorageBasedLocaleSwitcher implements LocaleSwitcherInterface\n {\n     public function __construct(\n         private LocaleStorageInterface $localeStorage,\n         private ChannelContextInterface $channelContext,\n-        private ?UrlMatcherInterface $urlMatcher = null,\n+        private RouterInterface $router,\n     ) {\n-        if (null === $this->urlMatcher) {\n-            trigger_deprecation(\n-                'sylius/shop-bundle',\n-                '2.1',\n-                'Not passing a \"%s\" to \"%s\" is deprecated and will be required in Sylius 3.0.',\n-                UrlMatcherInterface::class,\n-                self::class,\n-            );\n-        }\n     }\n\n     public function handle(Request $request, string $localeCode): RedirectResponse\n     {\n         $this->localeStorage->set($this->channelContext->getChannel(), $localeCode);\n-        $url = $request->headers->get('referer', $request->getSchemeAndHttpHost());\n-\n-        if ($this->urlMatcher) {\n-            try {\n-                $this->urlMatcher->match($url);\n-            } catch (ResourceNotFoundException) {\n-                return new RedirectResponse($request->getSchemeAndHttpHost());\n-            }\n-        }\n-\n-        return new RedirectResponse($url);\n+        return new RedirectResponse($this->router->generate('sylius_shop_homepage'));\n     }\n }\n```\n\n#### Step 4 - Override the services\n\nAdd to `config/services.yaml`.\n\n**Sylius 1.x (1.9 – 1.14):**\n\n```yaml\nservices:\n    # ... your existing services ...\n\n    sylius.controller.shop.currency_switch:\n        class: App\\Controller\\CurrencySwitchController\n        public: true\n        arguments:\n            $templatingEngine: '@twig'\n            $currencyStorage: '@sylius.storage.currency'\n            $channelContext: '@sylius.context.channel'\n            $router: '@router'\n\n    sylius.controller.shop.impersonate_user:\n        class: App\\Controller\\Admin\\ImpersonateUserController\n        public: true\n        arguments:\n            $impersonator: '@sylius.admin.security.user_impersonator'\n            $authorizationChecker: '@security.authorization_checker'\n            $userProvider: '@sylius.admin_user_provider.email_or_name_based'\n            $router: '@router'\n            $authorizationRole: 'ROLE_ADMINISTRATION_ACCESS'\n\n    # Only if you use locale_switcher: storage\n    sylius.shop.locale_switcher:\n        class: App\\Locale\\StorageBasedLocaleSwitcher\n        public: false\n        arguments:\n            $localeStorage: '@sylius.storage.locale'\n            $channelContext: '@sylius.context.channel'\n            $router: '@router'\n```\n\n**Sylius 2.x (2.0 – 2.1):**\n\n```yaml\nservices:\n    # ... your existing services ...\n\n    sylius_shop.controller.currency_switch:\n        class: App\\Controller\\CurrencySwitchController\n        public: true\n        arguments:\n            $currencyStorage: '@sylius.storage.currency'\n            $channelContext: '@sylius.context.channel'\n            $router: '@router'\n\n    sylius_admin.controller.impersonate_user:\n        class: App\\Controller\\Admin\\ImpersonateUserController\n        public: true\n        arguments:\n            $impersonator: '@sylius_admin.security.shop_user_impersonator'\n            $authorizationChecker: '@security.authorization_checker'\n            $userProvider: '@sylius.shop_user_provider.email_or_name_based'\n            $router: '@router'\n            $authorizationRole: 'ROLE_ADMINISTRATION_ACCESS'\n\n    # Only if you use locale_switcher: storage\n    sylius_shop.locale_switcher:\n        class: App\\Locale\\StorageBasedLocaleSwitcher\n        public: false\n        arguments:\n            $localeStorage: '@sylius.storage.locale'\n            $channelContext: '@sylius.context.channel'\n            $router: '@router'\n```\n\n#### Step 5 - Clear cache\n\n```bash\nbin/console cache:clear\n```\n\n---\n\n#### Customizing the redirect target\n\nIf you need a different redirect target, override the route definition with the `_sylius.redirect` attribute:\n\n```yaml\n# config/routes/sylius_shop.yaml (AFTER the sylius_shop resource import)\nsylius_shop_switch_currency:\n    path: /{_locale}/switch-currency/{code}\n    methods: [GET]\n    defaults:\n        _controller: sylius.controller.shop.currency_switch:switchAction\n        _sylius:\n            redirect: sylius_shop_product_index  # or any route name\n```\n\n### Reporters\n\nWe would like to extend our gratitude to the following individuals for their detailed reporting and responsible disclosure of this vulnerability:\n- Bartłomiej Nowiński (@bnBart)\n\n### For more information\n\nIf you have any questions or comments about this advisory:\n\n- Open an issue in [Sylius issues](https://github.com/Sylius/Sylius/issues?q=sort%3Aupdated-desc+is%3Aissue+is%3Aopen)\n- Email us at [security@sylius.com](mailto:security@sylius.com)",
                    "title": "github - https://github.com/advisories/GHSA-9ffx-f77r-756w"
                },
                {
                    "category": "other",
                    "text": "0.00045",
                    "title": "EPSS"
                },
                {
                    "category": "other",
                    "text": "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:N/SC:L/SI:L/SA:L",
                    "title": "CVSSV4"
                },
                {
                    "category": "other",
                    "text": "6.9",
                    "title": "CVSSV4 base score"
                },
                {
                    "category": "other",
                    "text": "4.4",
                    "title": "NCSC Score"
                },
                {
                    "category": "other",
                    "text": "The value of the most recent CVSS (V3) score, Is related to (a version of) an uncommon product",
                    "title": "NCSC Score top decreasing factors"
                }
            ],
            "product_status": {
                "known_affected": [
                    "CSAFPID-5778700",
                    "CSAFPID-5778701",
                    "CSAFPID-5778702",
                    "CSAFPID-5778745",
                    "CSAFPID-5778746",
                    "CSAFPID-5778747",
                    "CSAFPID-5778748",
                    "CSAFPID-5778749",
                    "CSAFPID-5778750"
                ]
            },
            "references": [
                {
                    "category": "external",
                    "summary": "Source - cveprojectv5",
                    "url": "https://www.cve.org/CVERecord?id=CVE-2026-31819"
                },
                {
                    "category": "external",
                    "summary": "Source raw - cveprojectv5",
                    "url": "https://raw.githubusercontent.com/CVEProject/cvelistV5/main/cves/2026/31xxx/CVE-2026-31819.json"
                },
                {
                    "category": "external",
                    "summary": "Source - nvd",
                    "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-31819"
                },
                {
                    "category": "external",
                    "summary": "Source raw - nvd",
                    "url": "https://services.nvd.nist.gov/rest/json/cves/2.0?cveId=CVE-2026-31819"
                },
                {
                    "category": "external",
                    "summary": "Source - github",
                    "url": "https://github.com/advisories/GHSA-9ffx-f77r-756w"
                },
                {
                    "category": "external",
                    "summary": "Source raw - github",
                    "url": "https://api.github.com/advisories/GHSA-9ffx-f77r-756w"
                },
                {
                    "category": "external",
                    "summary": "Source - first",
                    "url": "https://api.first.org/data/v1/epss?cve=CVE-2026-31819"
                },
                {
                    "category": "external",
                    "summary": "Source raw - first",
                    "url": "https://api.first.org/data/v1/epss?limit=10000&offset=0"
                },
                {
                    "category": "external",
                    "summary": "Source - github",
                    "url": "https://api.github.com/advisories/GHSA-9ffx-f77r-756w"
                },
                {
                    "category": "external",
                    "summary": "Source - first",
                    "url": "https://api.first.org/data/v1/epss?limit=10000&offset=0"
                },
                {
                    "category": "external",
                    "summary": "Reference - cveprojectv5; github; nvd",
                    "url": "https://github.com/Sylius/Sylius/security/advisories/GHSA-9ffx-f77r-756w"
                },
                {
                    "category": "external",
                    "summary": "Reference - github",
                    "url": "https://github.com/advisories/GHSA-9ffx-f77r-756w"
                },
                {
                    "category": "external",
                    "summary": "Reference - github",
                    "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-31819"
                }
            ],
            "scores": [
                {
                    "cvss_v3": {
                        "version": "3.1",
                        "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N",
                        "baseScore": 6.1,
                        "baseSeverity": "MEDIUM"
                    },
                    "products": [
                        "CSAFPID-5778700",
                        "CSAFPID-5778701",
                        "CSAFPID-5778702",
                        "CSAFPID-5778745",
                        "CSAFPID-5778746",
                        "CSAFPID-5778747",
                        "CSAFPID-5778748",
                        "CSAFPID-5778749",
                        "CSAFPID-5778750"
                    ]
                }
            ],
            "title": "CVE-2026-31819"
        }
    ]
}