CVE-2016-1902: SecureRandom's fallback not secure when OpenSSL fails
Symfony 2.3.0 to 2.3.36, 2.6.0 to 2.6.12, 2.7.0 to 2.7.8 versions of the
Security component are affected by this security issue when used with PHP 5.x
paragonie/random_compat library listed in your Composer
dependencies. Projects using PHP 7 are not affected.
This issue has been fixed in Symfony 2.3.37, 2.6.13, and 2.7.9. 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 are not affected.
SecureRandom Symfony class goal is to generate secure random numbers.
Several strategies are used depending on PHP's configuration. On PHP
installations where the
random_bytes() function is not available, Symfony
falls back to using
openssl_random_pseudo_bytes(). If that does not work,
Symfony generates a secure random number using
which are not suitable for cryptographic contexts.
The fix consists in removing all the custom code in favor of using the
paragonie/random_compat library as was already done in Symfony 2.8 and 3.0.
The patch for this issue is available here.
I would like to thank Lander Brandt for reporting this security issue. Thanks to Christian Flothmann for writing the fix for the various Symfony versions.
Have found a security issue in Symfony? Send the details to security [at] symfony.com and don't disclose it publicly until we can provide a fix for it.
Comments are closed.
To ensure that comments stay relevant, they are closed for old posts.