{
    "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-31822",
        "tracking": {
            "current_release_date": "2026-03-23T03:27:38.225335Z",
            "generator": {
                "date": "2026-02-17T15:00:00Z",
                "engine": {
                    "name": "V.E.L.M.A",
                    "version": "1.7"
                }
            },
            "id": "CVE-2026-31822",
            "initial_release_date": "2026-03-10T21:38:53.253780Z",
            "revision_history": [
                {
                    "date": "2026-03-10T21:38:53.253780Z",
                    "number": "1",
                    "summary": "CVE created.| Source created.| CVE status created. (valid)| Description created for source.| CVSS created.| Products connected (3).| References created (1).| CWES updated (1)."
                },
                {
                    "date": "2026-03-10T21:38:55.439922Z",
                    "number": "2",
                    "summary": "NCSC Score created."
                },
                {
                    "date": "2026-03-10T22:25:58.785933Z",
                    "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:22.640999Z",
                    "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-11T10:11:36.444877Z",
                    "number": "7",
                    "summary": "NCSC Score updated."
                },
                {
                    "date": "2026-03-11T14:54:34.060546Z",
                    "number": "8",
                    "summary": "Source created.| CVE status created. (valid)| EPSS created."
                },
                {
                    "date": "2026-03-11T14:54:42.152178Z",
                    "number": "9",
                    "summary": "NCSC Score updated."
                },
                {
                    "date": "2026-03-11T16:39:33.336829Z",
                    "number": "10",
                    "summary": "Unknown change."
                },
                {
                    "date": "2026-03-11T16:39:35.090859Z",
                    "number": "11",
                    "summary": "NCSC Score updated."
                },
                {
                    "date": "2026-03-11T20:25:56.703699Z",
                    "number": "12",
                    "summary": "CVSS created.| Products connected (3).| Product Identifiers created (3)."
                },
                {
                    "date": "2026-03-11T20:26:02.433501Z",
                    "number": "13",
                    "summary": "NCSC Score updated."
                },
                {
                    "date": "2026-03-11T20:40:57.846120Z",
                    "number": "14",
                    "summary": "Description removed for source.| Description created for source.| References created (1)."
                },
                {
                    "date": "2026-03-19T15:29:42.315468Z",
                    "number": "15",
                    "summary": "Source created.| CVE status created. (valid)| Description created for source.| CVSS created.| References created (3).| CWES updated (1)."
                },
                {
                    "date": "2026-03-19T15:29:44.783504Z",
                    "number": "16",
                    "summary": "NCSC Score updated."
                },
                {
                    "date": "2026-03-20T09:32:47.917928Z",
                    "number": "17",
                    "summary": "Source connected.| CVE status created. (valid)| EPSS created."
                }
            ],
            "status": "interim",
            "version": "17"
        }
    },
    "product_tree": {
        "branches": [
            {
                "branches": [
                    {
                        "branches": [
                            {
                                "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-31822",
            "cwe": {
                "id": "CWE-79",
                "name": "Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')"
            },
            "notes": [
                {
                    "category": "description",
                    "text": "### Impact\n\nA cross-site scripting (XSS) vulnerability exists in the shop checkout login form handled by the ApiLoginController Stimulus controller.                                                                                                               \n\nWhen a login attempt fails, AuthenticationFailureHandler returns a JSON response whose message field is rendered into the DOM using innerHTML, allowing any HTML or JavaScript in that value to be parsed and executed by the browser.\n\nThe message value originates from `AuthenticationException::getMessageKey()` passed through Symfony's translator (security domain, using the request locale). In the default Sylius installation, this returns a hardcoded translation key (e.g. \"Invalid credentials.\"), which is not directly user-controlled. However, using innerHTML with server-derived data violates defense-in-depth principles, and the risk escalates significantly under realistic scenarios:\n  - Customized authentication handlers — if a project overrides AuthenticationFailureHandler to include user-supplied data in the message (e.g. \"No account found for <username>\"), an attacker can inject arbitrary JavaScript directly via the login\n  form without any privileged access.\n  - Translation injection — if translation files are sourced from an untrusted database or CMS and contain HTML, the message could carry a malicious payload.\n  - Man-in-the-Middle — if the response is intercepted (e.g. on HTTP or via a compromised proxy), an attacker can inject arbitrary HTML/JS into the message field.\n  - Server-side injection — if any middleware, reverse proxy, or error handler modifies the JSON response body, malicious content could be injected into the message field.\n\nExploitation could lead to session hijacking, credential theft, cart/order manipulation, or phishing within the trusted shop domain.\n\nThe vulnerability affects all Sylius installations that use the default shop checkout login form with the bundled ApiLoginController.js.\n\n### Patches\nThe issue is fixed in versions: 2.0.16, 2.1.12, 2.2.3 and above.\n\n### Workarounds\nOverride the vulnerable JavaScript controller at the project level.\n> Note: Step 2 differs between Sylius 2.0 and up\n\n#### Step 1. Override JavaScript controller handling login\n### Patch ApiLoginController.js\n\nCopy the original from `vendor/sylius/sylius/src/Sylius/Bundle/ShopBundle/Resources/assets/controllers/ApiLoginController.js` to `assets/shop/controllers/ApiLoginController.js` and apply:\n```diff\n...\n  .then(response => {\n    if (response.success) {\n      window.location.reload();\n    } else {\n      const errorElement = this.errorPrototypeTarget.cloneNode(true);\n-     errorElement.innerHtml = response.message;\n+     errorElement.textContent = response.message;\n      this.errorTarget.innerHTML = errorElement.outerHTML;\n    }\n  })\n...\n```\n\n#### Step 2. Register the patched controller\n> Sylius 2.1+ (Stimulus Bridge with `controllers.json`)\n\nDisable the vendor controller in `assets/shop/controllers.json`:\n```diff\n...\n  \"api-login\": {\n-    \"enabled\": true,\n+    \"enabled\": false,\n    \"fetch\": \"lazy\"\n  }\n...\n```\nRegister the overwritten controller in `assets/shop/bootstrap.js`\n```js\nimport ApiLoginController from './controllers/ApiLoginController'\n\napp.register('sylius--shop-bundle--api-login', ApiLoginController);\n```\n---\n> Sylius 2.0 (explicit imports in vendor `app.js`)\n\nUse Webpack's `NormalModuleReplacementPlugin` to swap the controller at build time. In `webpack.config.js`, after `shopConfig` is created:\n\n```diff\n+ const webpack = require('webpack');\n...\n  // Shop config\n  const shopConfig = SyliusShop.getWebpackConfig(path.resolve(__dirname));\n+ shopConfig.plugins.push(\n+   new webpack.NormalModuleReplacementPlugin(\n+     /\\/controllers\\/ApiLoginController\\.js$/,\n+     path.resolve(__dirname, 'assets/shop/controllers/ApiLoginController.js')\n+   )\n+ );\n...\n```\n\n#### Step 3. Rebuild assets\n\n```bash\nyarn encore dev  # or: yarn encore production\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-vgh8-c6fp-7gcg"
                },
                {
                    "category": "description",
                    "text": "Sylius is an Open Source eCommerce Framework on Symfony. A cross-site scripting (XSS) vulnerability exists in the shop checkout login form handled by the ApiLoginController Stimulus controller. When a login attempt fails, AuthenticationFailureHandler returns a JSON response whose message field is rendered into the DOM using innerHTML, allowing any HTML or JavaScript in that value to be parsed and executed by the browser. The issue is fixed in versions: 2.0.16, 2.1.12, 2.2.3 and above.",
                    "title": "cveprojectv5 - https://www.cve.org/CVERecord?id=CVE-2026-31822"
                },
                {
                    "category": "description",
                    "text": "Sylius is an Open Source eCommerce Framework on Symfony. A cross-site scripting (XSS) vulnerability exists in the shop checkout login form handled by the ApiLoginController Stimulus controller. When a login attempt fails, AuthenticationFailureHandler returns a JSON response whose message field is rendered into the DOM using innerHTML, allowing any HTML or JavaScript in that value to be parsed and executed by the browser. The issue is fixed in versions: 2.0.16, 2.1.12, 2.2.3 and above.",
                    "title": "nvd - https://nvd.nist.gov/vuln/detail/CVE-2026-31822"
                },
                {
                    "category": "description",
                    "text": "### Impact\n\nA cross-site scripting (XSS) vulnerability exists in the shop checkout login form handled by the ApiLoginController Stimulus controller.                                                                                                               \n\nWhen a login attempt fails, AuthenticationFailureHandler returns a JSON response whose message field is rendered into the DOM using innerHTML, allowing any HTML or JavaScript in that value to be parsed and executed by the browser.\n\nThe message value originates from `AuthenticationException::getMessageKey()` passed through Symfony's translator (security domain, using the request locale). In the default Sylius installation, this returns a hardcoded translation key (e.g. \"Invalid credentials.\"), which is not directly user-controlled. However, using innerHTML with server-derived data violates defense-in-depth principles, and the risk escalates significantly under realistic scenarios:\n  - Customized authentication handlers — if a project overrides AuthenticationFailureHandler to include user-supplied data in the message (e.g. \"No account found for <username>\"), an attacker can inject arbitrary JavaScript directly via the login\n  form without any privileged access.\n  - Translation injection — if translation files are sourced from an untrusted database or CMS and contain HTML, the message could carry a malicious payload.\n  - Man-in-the-Middle — if the response is intercepted (e.g. on HTTP or via a compromised proxy), an attacker can inject arbitrary HTML/JS into the message field.\n  - Server-side injection — if any middleware, reverse proxy, or error handler modifies the JSON response body, malicious content could be injected into the message field.\n\nExploitation could lead to session hijacking, credential theft, cart/order manipulation, or phishing within the trusted shop domain.\n\nThe vulnerability affects all Sylius installations that use the default shop checkout login form with the bundled ApiLoginController.js.\n\n### Patches\nThe issue is fixed in versions: 2.0.16, 2.1.12, 2.2.3 and above.\n\n### Workarounds\nOverride the vulnerable JavaScript controller at the project level.\n> Note: Step 2 differs between Sylius 2.0 and up\n\n#### Step 1. Override JavaScript controller handling login\n### Patch ApiLoginController.js\n\nCopy the original from `vendor/sylius/sylius/src/Sylius/Bundle/ShopBundle/Resources/assets/controllers/ApiLoginController.js` to `assets/shop/controllers/ApiLoginController.js` and apply:\n```diff\n...\n  .then(response => {\n    if (response.success) {\n      window.location.reload();\n    } else {\n      const errorElement = this.errorPrototypeTarget.cloneNode(true);\n-     errorElement.innerHtml = response.message;\n+     errorElement.textContent = response.message;\n      this.errorTarget.innerHTML = errorElement.outerHTML;\n    }\n  })\n...\n```\n\n#### Step 2. Register the patched controller\n> Sylius 2.1+ (Stimulus Bridge with `controllers.json`)\n\nDisable the vendor controller in `assets/shop/controllers.json`:\n```diff\n...\n  \"api-login\": {\n-    \"enabled\": true,\n+    \"enabled\": false,\n    \"fetch\": \"lazy\"\n  }\n...\n```\nRegister the overwritten controller in `assets/shop/bootstrap.js`\n```js\nimport ApiLoginController from './controllers/ApiLoginController'\n\napp.register('sylius--shop-bundle--api-login', ApiLoginController);\n```\n---\n> Sylius 2.0 (explicit imports in vendor `app.js`)\n\nUse Webpack's `NormalModuleReplacementPlugin` to swap the controller at build time. In `webpack.config.js`, after `shopConfig` is created:\n\n```diff\n+ const webpack = require('webpack');\n...\n  // Shop config\n  const shopConfig = SyliusShop.getWebpackConfig(path.resolve(__dirname));\n+ shopConfig.plugins.push(\n+   new webpack.NormalModuleReplacementPlugin(\n+     /\\/controllers\\/ApiLoginController\\.js$/,\n+     path.resolve(__dirname, 'assets/shop/controllers/ApiLoginController.js')\n+   )\n+ );\n...\n```\n\n#### Step 3. Rebuild assets\n\n```bash\nyarn encore dev  # or: yarn encore production\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-vgh8-c6fp-7gcg"
                },
                {
                    "category": "other",
                    "text": "0.00042",
                    "title": "EPSS"
                },
                {
                    "category": "other",
                    "text": "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N",
                    "title": "CVSSV4"
                },
                {
                    "category": "other",
                    "text": "5.3",
                    "title": "CVSSV4 base score"
                },
                {
                    "category": "other",
                    "text": "4.0",
                    "title": "NCSC Score"
                },
                {
                    "category": "other",
                    "text": "The value of the most recent CVSS (V3) score, Is related to (a version of) an uncommon product, Is related to CWE-79 (Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'))",
                    "title": "NCSC Score top decreasing factors"
                }
            ],
            "product_status": {
                "known_affected": [
                    "CSAFPID-5778700",
                    "CSAFPID-5778701",
                    "CSAFPID-5778702"
                ]
            },
            "references": [
                {
                    "category": "external",
                    "summary": "Source - cveprojectv5",
                    "url": "https://www.cve.org/CVERecord?id=CVE-2026-31822"
                },
                {
                    "category": "external",
                    "summary": "Source raw - cveprojectv5",
                    "url": "https://raw.githubusercontent.com/CVEProject/cvelistV5/main/cves/2026/31xxx/CVE-2026-31822.json"
                },
                {
                    "category": "external",
                    "summary": "Source - nvd",
                    "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-31822"
                },
                {
                    "category": "external",
                    "summary": "Source raw - nvd",
                    "url": "https://services.nvd.nist.gov/rest/json/cves/2.0?cveId=CVE-2026-31822"
                },
                {
                    "category": "external",
                    "summary": "Source - github",
                    "url": "https://github.com/advisories/GHSA-vgh8-c6fp-7gcg"
                },
                {
                    "category": "external",
                    "summary": "Source raw - github",
                    "url": "https://api.github.com/advisories/GHSA-vgh8-c6fp-7gcg"
                },
                {
                    "category": "external",
                    "summary": "Source - first",
                    "url": "https://api.first.org/data/v1/epss?cve=CVE-2026-31822"
                },
                {
                    "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-vgh8-c6fp-7gcg"
                },
                {
                    "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-vgh8-c6fp-7gcg"
                },
                {
                    "category": "external",
                    "summary": "Reference - github",
                    "url": "https://github.com/advisories/GHSA-vgh8-c6fp-7gcg"
                },
                {
                    "category": "external",
                    "summary": "Reference - github",
                    "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-31822"
                }
            ],
            "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"
                    ]
                }
            ],
            "title": "CVE-2026-31822"
        }
    ]
}