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
composer require symfony/security-bundle:^4.4.50- Affected
- >=5.0.0 <5.4.20
- Fixed in
- 5.4.20
composer require symfony/security-bundle:^5.4.20- Affected
- >=6.0.0 <6.0.20
- Fixed in
- 6.0.20
composer require symfony/security-bundle:^6.0.20- Affected
- >=6.1.0 <6.1.12
- Fixed in
- 6.1.12
composer require symfony/security-bundle:^6.1.12- Affected
- >=6.2.0 <6.2.6
- Fixed in
- 6.2.6
composer require symfony/security-bundle:^6.2.6- Affected
- >=2.0.0 <4.4.50
- Fixed in
- 4.4.50
composer require symfony/symfony:^4.4.50- Affected
- >=5.0.0 <5.4.20
- Fixed in
- 5.4.20
composer require symfony/symfony:^5.4.20- Affected
- >=6.0.0 <6.0.20
- Fixed in
- 6.0.20
composer require symfony/symfony:^6.0.20- Affected
- >=6.1.0 <6.1.12
- Fixed in
- 6.1.12
composer require symfony/symfony:^6.1.12- Affected
- >=6.2.0 <6.2.6
- Fixed in
- 6.2.6
composer require symfony/symfony:^6.2.6Details
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
- Linkgithub.com/symfony/symfony/security/advisories/GHSA-3gv2-29qc-v67m
- Advisorynvd.nist.gov/vuln/detail/CVE-2022-24895
- Linkgithub.com/symfony/security-bundle/commit/076fd2088ada33d760758d98ff07ddedbf567946
- Linkgithub.com/symfony/symfony/commit/5909d74ecee359ea4982fcf4331aaf2e489a1fd4
- Linkgithub.com/FriendsOfPHP/security-advisories/blob/master/symfony/security-bundle/CVE-2022-24895.yaml
- Linkgithub.com/FriendsOfPHP/security-advisories/blob/master/symfony/symfony/CVE-2022-24895.yaml
- Packagegithub.com/symfony/symfony
- Linklists.debian.org/debian-lts-announce/2023/07/msg00014.html
- Linksymfony.com/cve-2022-24895
Advisory data from OSV.dev (opens OSV.dev in a new tab), refreshed daily.