# GHSA-h9wq-xcqx-mqxm: Vendure Cross Site Request Forgery vulnerability impacting all API requests

> Insecure default cookie settings in Vendure allow Cross-Site Request Forgery attacks against all API requests, requiring manual configuration changes to mitigate.

- **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:** 11 Jul 2023

## What is GHSA-h9wq-xcqx-mqxm?

GHSA-h9wq-xcqx-mqxm is a vulnerability in @vendure/core, published on 11 Jul 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
Vendure is an e-commerce GraphQL framework with a number of APIs and different levels of
authorization. By default the Cookie settings are insecure, having the SameSite setting as false
which results in not having one (originates from the cookie-session npm package’s default
settings).

### Patches
In progress

### Workarounds
Manually set the `authOptions.cookieOptions.sameSite` configuration option to `'strict'`, `'lax'` or `true`.

### References
_Are there any links users can visit to find out more?_

## Which versions are affected by GHSA-h9wq-xcqx-mqxm?

2 open source packages ship an affected version, including @vendure/core.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `@vendure/core` | npm | All versions | 2.0.3 |
| `@vendure/core` | npm | All versions | 2.0.3 |

## How do I fix GHSA-h9wq-xcqx-mqxm?

Upgrade @vendure/core to 2.0.3 or later.

## Is GHSA-h9wq-xcqx-mqxm being exploited?

There is no known exploitation of GHSA-h9wq-xcqx-mqxm in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-h9wq-xcqx-mqxm and fix it if it is affected.

What it is: GHSA-h9wq-xcqx-mqxm is a vulnerability in @vendure/core, published on 11 Jul 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-h9wq-xcqx-mqxm in the wild and no public exploit code.

Affected packages and fixed versions:
- @vendure/core (npm): affected all versions; fixed in 2.0.3
- @vendure/core (npm): affected all versions; fixed in 2.0.3

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-h9wq-xcqx-mqxm/ (Markdown: https://insights.sbomify.com/GHSA-h9wq-xcqx-mqxm/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-h9wq-xcqx-mqxm

---
From sbomify Insights: https://insights.sbomify.com/GHSA-h9wq-xcqx-mqxm/
Summaries are generated and may contain mistakes; the official description above is the record.
