# GHSA-8wx3-8m4x-g5h4: FOSUserBundle User Identity Validation Vulnerability

> An attacker can bypass identity validation if username changes are allowed, potentially leading to privilege escalation or unauthorized access.

- **Severity:** Not scored
- **Exploited in the wild:** Not known
- **Login needed:** Any signed-in user
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 15 May 2024

## What is GHSA-8wx3-8m4x-g5h4?

GHSA-8wx3-8m4x-g5h4 is an authentication bypass vulnerability in friendsofsymfony/user-bundle, published on 15 May 2024. Any signed-in user can exploit it over the network, with no action from the victim.

### Official description

Versions of FOSUserBundle prior to 1.2.1 have been found to be vulnerable to a security issue related to user identity validation. Specifically, user refreshing was performed using the primary key instead of the username, leading to a potential security risk if a user is allowed to change their username. The fix in version 1.2.1 addresses this issue by loading the user using the primary key during refreshing.

## Which versions are affected by GHSA-8wx3-8m4x-g5h4?

2 open source packages ship an affected version, including friendsofsymfony/user-bundle.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `friendsofsymfony/user-bundle` | Packagist | From 1.0.0 | 1.2.1 |
| `friendsofsymfony/user-bundle` | Packagist | From 1.0.0 | 1.2.1 |

## How do I fix GHSA-8wx3-8m4x-g5h4?

Upgrade friendsofsymfony/user-bundle to 1.2.1 or later.

## Is GHSA-8wx3-8m4x-g5h4 being exploited?

There is no known exploitation of GHSA-8wx3-8m4x-g5h4 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-8wx3-8m4x-g5h4 and fix it if it is affected.

What it is: GHSA-8wx3-8m4x-g5h4 is an authentication bypass vulnerability in friendsofsymfony/user-bundle, published on 15 May 2024. Any signed-in user can exploit it over the network, with no action from the victim.
Exploitation: There is no known exploitation of GHSA-8wx3-8m4x-g5h4 in the wild and no public exploit code.

Affected packages and fixed versions:
- friendsofsymfony/user-bundle (Packagist): affected from 1.0.0; fixed in 1.2.1
- friendsofsymfony/user-bundle (Packagist): affected from 1.0.0; fixed in 1.2.1

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-8wx3-8m4x-g5h4/ (Markdown: https://insights.sbomify.com/GHSA-8wx3-8m4x-g5h4/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-8wx3-8m4x-g5h4

---
From sbomify Insights: https://insights.sbomify.com/GHSA-8wx3-8m4x-g5h4/
Summaries are generated and may contain mistakes; the official description above is the record.
