GHSA-7mx2-7q8p-pgmw

Suggest an improvement
Source
https://github.com/advisories/GHSA-7mx2-7q8p-pgmw
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2024/05/GHSA-7mx2-7q8p-pgmw/GHSA-7mx2-7q8p-pgmw.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-7mx2-7q8p-pgmw
Published
2024-05-30T00:56:00Z
Modified
2024-12-04T05:40:59.357341Z
Severity
  • 6.5 (Medium) CVSS_V3 - CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N CVSS Calculator
Summary
Symfony may allow a user to switch to using another user's identity
Details

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

Database specific
{
    "nvd_published_at": null,
    "cwe_ids": [
        "CWE-287"
    ],
    "severity": "MODERATE",
    "github_reviewed": true,
    "github_reviewed_at": "2024-05-30T00:56:00Z"
}
References

Affected packages

Packagist / symfony/symfony

Package

Name
symfony/symfony
Purl
pkg:composer/symfony/symfony

Affected ranges

Type
ECOSYSTEM
Events
Introduced
2.0.0
Fixed
2.0.6

Affected versions

2.*

2.0.4
2.0.5