# GHSA-cfxh-frx4-9gjg: Cross-site Scripting in @spscommerce/ds-react

> Cross-site scripting vulnerability in SPS Commerce React UI library allows attackers to execute scripts via user-controlled options.

- **Severity:** Not scored
- **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:** Yes
- **Published:** 15 Dec 2023

## What is GHSA-cfxh-frx4-9gjg?

GHSA-cfxh-frx4-9gjg is a cross-site scripting vulnerability in @spscommerce/ds-react, published on 15 Dec 2023. 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

### Impact
XSS, anyone using the SPS Select with options prop populated from user input is impacted. If these options are stored, then it could have been a stored XSS. 

### Patches
The code has been patched for version 7 of woodland. Users should upgrade to 7.17.4 or higher

### Workarounds
This is not recommended. If you are not upgrading then you would need to sanitize your options yourself (including those currently stored in databases). This is not recommended.

### References
https://github.com/SPSCommerce/woodland/blob/c49e999f97f3c0b56502859f4de1e8c6666dd74d/packages/ds-react/src/option-list/SpsOptionList.tsx#L559

## Which versions are affected by GHSA-cfxh-frx4-9gjg?

2 open source packages ship an affected version, including @spscommerce/ds-react.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `@spscommerce/ds-react` | npm | From 4.12.2 | 7.17.4 |
| `@spscommerce/ds-react` | npm | From 4.12.2 | 7.17.4 |

## How do I fix GHSA-cfxh-frx4-9gjg?

Upgrade @spscommerce/ds-react to 7.17.4 or later.

## Is GHSA-cfxh-frx4-9gjg being exploited?

There is no known exploitation of GHSA-cfxh-frx4-9gjg in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-cfxh-frx4-9gjg and fix it if it is affected.

What it is: GHSA-cfxh-frx4-9gjg is a cross-site scripting vulnerability in @spscommerce/ds-react, published on 15 Dec 2023. 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 GHSA-cfxh-frx4-9gjg in the wild and no public exploit code.

Affected packages and fixed versions:
- @spscommerce/ds-react (npm): affected from 4.12.2; fixed in 7.17.4
- @spscommerce/ds-react (npm): affected from 4.12.2; fixed in 7.17.4

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/GHSA-cfxh-frx4-9gjg/ (Markdown: https://insights.sbomify.com/GHSA-cfxh-frx4-9gjg/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-cfxh-frx4-9gjg

---
From sbomify Insights: https://insights.sbomify.com/GHSA-cfxh-frx4-9gjg/
Summaries are generated and may contain mistakes; the official description above is the record.
