HighGHSA-vvmr-8829-6whxBIT-symfony-2022-23601CVE-2022-23601

CSRF token missing in Symfony

Published 1 Feb 2022 · Updated 22 Apr 2024

Affected packages

Affected
>=5.3.14 <5.3.15
Fixed in
5.3.15
Update to the fixed version for your release line, for example:composer require symfony/framework-bundle:^5.3.15
Affected
>=5.4.3 <5.4.4
Fixed in
5.4.4
Update to the fixed version for your release line, for example:composer require symfony/framework-bundle:^5.4.4
Affected
>=6.0.3 <6.0.4
Fixed in
6.0.4
Update to the fixed version for your release line, for example:composer require symfony/framework-bundle:^6.0.4

Details

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

The Symfony form component provides a CSRF protection mechanism by using a random token injected in the form and using the session to store and control the token submitted by the user. When using the FrameworkBundle, this protection can be enabled or disabled with the configuration. If the configuration is not specified, by default, the mechanism is enabled as long as the session is enabled.

In a recent change in the way the configuration is loaded, the default behavior has been dropped and, as a result, the CSRF protection is not enabled in form when not explicitly enabled, which makes the application sensible to CSRF attacks.

Resolution ----------

Symfony restored the default configuration to enable the CSRF protection by default.

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

Credits -------

We would like to thank Catalin Dan and David Lochner for reporting the issue and Jérémy Derussé for fixing the issue.

Is GHSA-vvmr-8829-6whx 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/framework-bundle, and gives you the command that fixes it.

References

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