Affected Versions

Symfony 2.3.0 to 2.3.34, 2.6.0 - 2.6.11, 2.7.0 - 2.7.6 versions of the Security component are affected by this security issue.

This issue has been fixed in Symfony 2.3.35, 2.6.12, and 2.7.7. Note that no fixes are provided for Symfony 2.4 and 2.5 as they are not maintained anymore. Symfony 2.8 and 3.0 haven't been released yet and the fix will be included in their first stable releases.

Description

A potential remote timing attack vulnerability has been found in the Symfony\Component\Security\Http\RememberMe\PersistentTokenBasedRememberMeServices class from the Symfony Security Component. While working on a fix, we also found some more occurrences in the Symfony\Component\Security\Http\Firewall\DigestAuthenticationListener class from the Symfony Security component and in the legacy CSRF implementation from the Symfony Form component (Symfony\Component\Form\Extension\Csrf\CsrfProvider\DefaultCsrfProvider).

Resolution

The fix uses the PHP built-in hash_equals() function when available or falls back to the Symfony built-in StringUtils::equals() method. We also highly recommend you to add symfony/polyfill-php56 as a requirement to your project as it provides a userland implementation of hash_equals().

The patch for this issue is available here.

Credits

I would like to thank Sebastiaan Stok for reporting this security issue and Christian Flothmann for writing the fix.

Published in #Security Advisories