# GHSA-2hpc-mf4q-j885: Silverstripe CSRF vulnerability in GridFieldAddExistingAutocompleter

> Attackers can trick CMS users into submitting unauthorized data via CSRF, potentially modifying groups, users, or permissions.

- **Severity:** Not scored
- **Exploited in the wild:** Not known
- **Login needed:** Any signed-in user
- **Attackable:** Over the internet
- **Victim action needed:** A user has to click or open something
- **Fix available:** Yes
- **Published:** 23 May 2024

## What is GHSA-2hpc-mf4q-j885?

GHSA-2hpc-mf4q-j885 is a vulnerability in silverstripe/framework, published on 23 May 2024. Any signed-in user can exploit it over the network, and only if a user opens a file or follows a link.

### Official description

GridField does not have sufficient CSRF protection, meaning that in some cases users with CMS access can be tricked into posting unspecified data into the CMS from external websites. Amongst other default CMS interfaces, GridField is used for management of groups, users and permissions in the CMS.

The resolution for this issue is to ensure that all gridFieldAlterAction submissions are checked for the SecurityID token during submission.

## Which versions are affected by GHSA-2hpc-mf4q-j885?

6 open source packages ship an affected version, including silverstripe/framework.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `silverstripe/framework` | Packagist | All versions | 3.1.17 |
| `silverstripe/framework` | Packagist | All versions | 3.1.17 |
| `silverstripe/framework` | Packagist | From 3.2.0 | 3.2.2 |
| `silverstripe/framework` | Packagist | From 3.2.0 | 3.2.2 |
| `silverstripe/framework` | Packagist | From 3.3.0-beta1 | 3.3.0 |
| `silverstripe/framework` | Packagist | From 3.3.0-beta1 | 3.3.0 |

## How do I fix GHSA-2hpc-mf4q-j885?

Upgrade silverstripe/framework to a fixed version for your release line: 3.1.17, 3.2.2 or 3.3.0.

## Is GHSA-2hpc-mf4q-j885 being exploited?

There is no known exploitation of GHSA-2hpc-mf4q-j885 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-2hpc-mf4q-j885 and fix it if it is affected.

What it is: GHSA-2hpc-mf4q-j885 is a vulnerability in silverstripe/framework, published on 23 May 2024. Any signed-in user can exploit it over the network, and only if a user opens a file or follows a link.
Exploitation: There is no known exploitation of GHSA-2hpc-mf4q-j885 in the wild and no public exploit code.

Affected packages and fixed versions:
- silverstripe/framework (Packagist): affected all versions; fixed in 3.1.17
- silverstripe/framework (Packagist): affected all versions; fixed in 3.1.17
- silverstripe/framework (Packagist): affected from 3.2.0; fixed in 3.2.2
- silverstripe/framework (Packagist): affected from 3.2.0; fixed in 3.2.2
- silverstripe/framework (Packagist): affected from 3.3.0-beta1; fixed in 3.3.0
- silverstripe/framework (Packagist): affected from 3.3.0-beta1; fixed in 3.3.0

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-2hpc-mf4q-j885/ (Markdown: https://insights.sbomify.com/GHSA-2hpc-mf4q-j885/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-2hpc-mf4q-j885

---
From sbomify Insights: https://insights.sbomify.com/GHSA-2hpc-mf4q-j885/
Summaries are generated and may contain mistakes; the official description above is the record.
