Advisory Database
  • Advisories
  • Dependency Scanning
  1. composer
  2. ›
  3. symfony/symfony
  4. ›
  5. GHSA-7mx2-7q8p-pgmw

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

May 30, 2024

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

References

  • github.com/FriendsOfPHP/security-advisories/blob/master/symfony/symfony/2011-11-16.yaml
  • github.com/advisories/GHSA-7mx2-7q8p-pgmw
  • github.com/symfony/symfony
  • github.com/symfony/symfony/commit/9d2ab9ca9c1762
  • symfony.com/blog/security-release-symfony-2-0-6

Code Behaviors & Features

Detect and mitigate GHSA-7mx2-7q8p-pgmw with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions starting from 2.0.0 before 2.0.6

Fixed versions

  • 2.0.6

Solution

Upgrade to version 2.0.6 or above.

Impact 6.5 MEDIUM

CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N

Learn more about CVSS

Weakness

  • CWE-287: Improper Authentication

Source file

packagist/symfony/symfony/GHSA-7mx2-7q8p-pgmw.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Wed, 14 May 2025 12:14:43 +0000.