MediumGHSA-3gv2-29qc-v67mBIT-symfony-2022-24895CVE-2022-24895

Symfony vulnerable to Session Fixation of CSRF tokens

Published 1 Feb 2023 · Updated 13 Feb 2025

Affected packages

Affected
>=2.0.0 <4.4.50
Fixed in
4.4.50
Update to the fixed version for your release line, for example:composer require symfony/security-bundle:^4.4.50
Affected
>=5.0.0 <5.4.20
Fixed in
5.4.20
Update to the fixed version for your release line, for example:composer require symfony/security-bundle:^5.4.20
Affected
>=6.0.0 <6.0.20
Fixed in
6.0.20
Update to the fixed version for your release line, for example:composer require symfony/security-bundle:^6.0.20
Affected
>=6.1.0 <6.1.12
Fixed in
6.1.12
Update to the fixed version for your release line, for example:composer require symfony/security-bundle:^6.1.12
Affected
>=6.2.0 <6.2.6
Fixed in
6.2.6
Update to the fixed version for your release line, for example:composer require symfony/security-bundle:^6.2.6
Affected
>=2.0.0 <4.4.50
Fixed in
4.4.50
Update to the fixed version for your release line, for example:composer require symfony/symfony:^4.4.50
Affected
>=5.0.0 <5.4.20
Fixed in
5.4.20
Update to the fixed version for your release line, for example:composer require symfony/symfony:^5.4.20
Affected
>=6.0.0 <6.0.20
Fixed in
6.0.20
Update to the fixed version for your release line, for example:composer require symfony/symfony:^6.0.20
Affected
>=6.1.0 <6.1.12
Fixed in
6.1.12
Update to the fixed version for your release line, for example:composer require symfony/symfony:^6.1.12
Affected
>=6.2.0 <6.2.6
Fixed in
6.2.6
Update to the fixed version for your release line, for example:composer require symfony/symfony:^6.2.6

Details

Description -----------

When authenticating users Symfony by default regenerates the session ID upon login, but preserves the rest of session attributes. Because this does not clear CSRF tokens upon login, this might enables same-site attackers to bypass the CSRF protection mechanism by performing an attack similar to a session-fixation.

Resolution ----------

Symfony removes all CSRF tokens from the session on successful login.

The patch for this issue is available here for branch 4.4.

Credits -------

We would like to thank Marco Squarcina for reporting the issue and Nicolas Grekas for fixing it.

Is GHSA-3gv2-29qc-v67m in any of your client repos?

Checking one package by hand is fine. Checking it across forty client projects is not. NPMscan reads the lockfiles in every GitHub repo you pick, finds each project with an affected symfony/security-bundle, and gives you the command that fixes it.

References

Advisory data from OSV.dev (opens OSV.dev in a new tab), refreshed daily.