# GHSA-7mx2-7q8p-pgmw: Symfony may allow a user to switch to using another user's identity

- Severity: Medium 6.5 (CVSS:3.1, scored by GitHub) `CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Published: 2024-05-30T00:56:00.000Z
- Modified: 2024-12-04T05:40:59.357Z
- Weaknesses: CWE-287

## Description

Symfony 2.0.6 has just been released. It addresses a security vulnerability in the EntityUserProvider as provided in the Doctrine bridge.

If you let your users update their login/username from a form, and if you are using Doctrine as a user provider, then you are vulnerable and you should upgrade as soon as possible.

The issue is that it is possible for a user to switch to another one. Here is how to reproduce it: The current user changes its username via a form to another existing username. When the form is submitted, he will have a validation error (as the username already exists) but the user object in the session will still be modified to the new username. This user from the session will be used for the next requests and so the user will be switched to this other user.

The fix is to always refresh the user via the primary key (which cannot be updated via a form) instead of the username.

If you cannot upgrade immediately, please apply the following patch: https://github.com/symfony/symfony/commit/9d2ab9ca9c1762

(As written by GitHub Advisory Database.)

## Affected

- symfony/symfony (Packagist): from 2.0.0 before 2.0.6

## References

- <https://github.com/symfony/symfony/commit/9d2ab9ca9c1762> (web)
- <https://github.com/FriendsOfPHP/security-advisories/blob/master/symfony/symfony/2011-11-16.yaml> (web)
- <https://github.com/symfony/symfony> (package)
- <https://symfony.com/blog/security-release-symfony-2-0-6> (web)

## Sources

- GitHub Advisory Database: [GHSA-7mx2-7q8p-pgmw](https://github.com/advisories/GHSA-7mx2-7q8p-pgmw), CC-BY-4.0, modified 2024-12-04

---

Page: https://cve.day/GHSA-7mx2-7q8p-pgmw · Whole record: https://cve.day/GHSA-7mx2-7q8p-pgmw.json · Rebuilt by cve.day 2026-11-25T22:56:31.495Z
