# CVE-2022-40631: Cross-site scripting in SCALANCE X200-4P IRT

> Cross-site scripting vulnerability in Siemens SCALANCE switches allows attackers to hijack user sessions.

- **Severity:** Medium 6.1 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** A user has to click or open something
- **Fix available:** No
- **Published:** 11 Oct 2022
- **Updated:** 3 Aug 2024
- **Also known as:** GHSA-hxq2-rx6m-372p

## What is CVE-2022-40631?

CVE-2022-40631 is a medium-severity cross-site scripting vulnerability in Siemens SCALANCE X200-4P IRT, published on 11 Oct 2022. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

### Official description

A vulnerability has been identified in SCALANCE X200-4P IRT (All versions < V5.5.0), SCALANCE X201-3P IRT (All versions < V5.5.0), SCALANCE X201-3P IRT PRO (All versions < V5.5.0), SCALANCE X202-2IRT (All versions < V5.5.0), SCALANCE X202-2P IRT (All versions < V5.5.0), SCALANCE X202-2P IRT PRO (All versions < V5.5.0), SCALANCE X204-2 (All versions < V5.2.5), SCALANCE X204-2FM (All versions < V5.2.5), SCALANCE X204-2LD (All versions < V5.2.5), SCALANCE X204-2LD TS (All versions < V5.2.5), SCALANCE X204-2TS (All versions < V5.2.5), SCALANCE X204IRT (All versions < V5.5.0), SCALANCE X204IRT PRO (All versions < V5.5.0), SCALANCE X206-1 (All versions < V5.2.5), SCALANCE X206-1LD (All versions < V5.2.5), SCALANCE X208 (All versions < V5.2.5), SCALANCE X208PRO (All versions < V5.2.5), SCALANCE X212-2 (All versions < V5.2.5), SCALANCE X212-2LD (All versions < V5.2.5), SCALANCE X216 (All versions < V5.2.5), SCALANCE X224 (All versions < V5.2.5), SCALANCE XF201-3P IRT (All versions < V5.5.0), SCALANCE XF202-2P IRT (All versions < V5.5.0), SCALANCE XF204 (All versions < V5.2.5), SCALANCE XF204-2 (All versions < V5.2.5), SCALANCE XF204-2BA IRT (All versions < V5.5.0), SCALANCE XF204IRT (All versions < V5.5.0), SCALANCE XF206-1 (All versions < V5.2.5), SCALANCE XF208 (All versions < V5.2.5), SIPLUS NET SCALANCE X202-2P IRT (All versions < V5.5.0). There is a cross-site scripting vulnerability on the affected devices, that if used by a threat actor, it could result in session hijacking.

Weakness: CWE-79 (Improper Neutralization of Input During Web Page Generation)

## Which versions are affected by CVE-2022-40631?

It affects 30 products.


Products: Siemens Scalance X200-4p Irt Firmware, Siemens Scalance X201-3p Irt Firmware, Siemens Scalance X201-3p Irt Pro Firmware, Siemens Scalance X202-2irt Firmware, Siemens Scalance X202-2p Irt Firmware, Siemens Scalance X202-2p Irt Pro Firmware, Siemens Scalance X204-2 Firmware, Siemens Scalance X204-2fm Firmware, Siemens Scalance X204-2ld Firmware, Siemens Scalance X204-2ld Ts Firmware, Siemens Scalance X204-2ts Firmware, Siemens Scalance X204irt Firmware, Siemens Scalance X204irt Pro Firmware, Siemens Scalance X206-1 Firmware, Siemens Scalance X206-1ld Firmware, Siemens Scalance X208 Firmware, Siemens Scalance X208pro Firmware, Siemens Scalance X212-2 Firmware, Siemens Scalance X212-2ld Firmware, Siemens Scalance X216 Firmware and 10 more.

## How do I fix CVE-2022-40631?

No fix has been published for CVE-2022-40631 yet. Limit exposure of the affected software until one is available.

## Is CVE-2022-40631 being exploited?

There is no known exploitation of CVE-2022-40631 in the wild and no public exploit code.

## Other vulnerabilities in Siemens SCALANCE X200-4P IRT

- [CVE-2021-25668](https://insights.sbomify.com/CVE-2021-25668/): Memory corruption in SCALANCE X200-4P IRT (critical 9.8)
- [CVE-2021-25669](https://insights.sbomify.com/CVE-2021-25669/): Memory corruption in SCALANCE X200-4P IRT (critical 9.8)
- [CVE-2022-26649](https://insights.sbomify.com/CVE-2022-26649/): Denial of service in SCALANCE X200-4P IRT (critical 9.6)
- [CVE-2022-26647](https://insights.sbomify.com/CVE-2022-26647/): Weak cryptography in SCALANCE X200-4P IRT (high 8.8)
- [CVE-2022-26648](https://insights.sbomify.com/CVE-2022-26648/): Denial of service in SCALANCE X200-4P IRT (high 8.2)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2022-40631 and fix it if it is affected.

What it is: CVE-2022-40631 is a medium-severity cross-site scripting vulnerability in Siemens SCALANCE X200-4P IRT, published on 11 Oct 2022. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.
Exploitation: There is no known exploitation of CVE-2022-40631 in the wild and no public exploit code.

Affected product: Siemens SCALANCE X200-4P IRT. No package-level version data is available, so check the vendor advisory linked from the reference page.

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2022-40631/ (Markdown: https://insights.sbomify.com/CVE-2022-40631/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2022-40631
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2022-40631
- OSV: https://osv.dev/vulnerability/CVE-2022-40631

---
From sbomify Insights: https://insights.sbomify.com/CVE-2022-40631/
Summaries are generated and may contain mistakes; the official description above is the record.
