CVE-2017-16653: CSRF protection does not use different tokens for HTTP and HTTPS
November 17, 2017 • Published by Fabien Potencier
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 withHttpFoundation
.
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.
Manage your notification preferences to receive an email as soon as a Symfony security release is published.
Help the Symfony project!
As with any Open-Source project, contributing code or documentation is the most common way to help, but we also have a wide range of sponsoring opportunities.
Comments are closed.
To ensure that comments stay relevant, they are closed for old posts.
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?