Symfony 4 was released on November 30th.
Update now to the best Symfony ever!

CVE-2017-16653: CSRF protection does not use different tokens for HTTP and HTTPS

Affected versions

Symfony 2.7.0 to 2.7.37, 2.8.0 to 2.8.30, 3.2.0 to 3.2.13, and 3.3.0 to 3.3.12 versions of the Symfony Security component are affected by this security issue.

The issue has been fixed in Symfony 2.7.38, 2.8.31, 3.2.14, 3.3.13, 3.4-BETA5, and 4.0-BETA5.

Note that no fixes are provided for Symfony 3.0 and 3.1 as they are not maintained anymore.

Description

The implementation of CSRF protection did not use different tokens for HTTP and HTTPS, therefore the token was subject to MITM attacks on HTTP and could then be used in HTTPS context to do CSRF attacks.

Resolution

The tokens are now namespaced by default to differentiate HTTP from HTTPS.

Note that this patch introduces a small BC break (the token ID can change, and isn't the one specified by the user in some cases) but has the benefit of fixing all use cases:

  • Form component;
  • Login and logout security listeners;
  • Direct usage of the security.csrf.token_manager service;
  • Direct usage of the CsrfTokenManager (component without the full stack framework) even if not used with HttpFoundation.

The previous behavior can be restored by using '' as namespace.

The patch for this issue is available here.

Credits

I would like to thank Oliver Hoff for reporting this security issue, Kevin Dunglas for providing a fix, and the Symfony Core Team for reviewing the patch.

If you have found a security issue in Symfony, please send the details to security [at] symfony.com and don't disclose it publicly until we can provide a fix for it.

Comments

> Symfony 2.7.0 to 2.7.37, 2.8.0 to 2.8.30, 3.2.0 to 3.2.13, and 3.3.0 to 3.3.12 versions of the Symfony Intl component are affected by this security issue.

Is it really that this vuln is of Intl component?
Patch link does not work. There is a ">" at the end of the URL.
We've updated the blog post to fix everything. Thanks for reporting these issues.
There is not BETA5 tags.
Will there have a fix for other version?
Login with SensioLabsConnect to post a comment