CVE-2016-1902: Symfony Cryptographic Vulnerability

symfony/security-core Updated 02 Oct 2025

Summary

17/05/2022
Yes i
High
7.5

CVE-2016-1902: Symfony Cryptographic Vulnerability. Affects symfony/security-core across 2 version ranges.

>= 2.4.0, < 2.6.13 >= 2.7.0, < 2.7.9

Fixed in 2.6.13 or 2.7.9, depending on the release line you run. How to fix ↓

Also tracked for

The same CVE-2016-1902 is tracked separately for each ecosystem and vendor. Its fix information is the same; the package and affected versions differ.

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Penetration testing for web, API and mobile Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

Symfony is a popular PHP framework used for developing web applications. It provides a set of reusable components and tools that simplify the development process. The SecureRandom class in Symfony is responsible for generating random numbers used for cryptographic operations. However, versions before 2.3.37, 2.6.x before 2.6.13, and 2.7.x before 2.7.9 have a vulnerability in the nextBytes function. When used with PHP 5.x without the paragonie/random_compat library and the openssl_random_pseudo_bytes function fails, the random numbers generated are not secure. This vulnerability can be exploited by attackers to bypass cryptographic protection mechanisms.

Vulnerability Detail

The vulnerability in Symfony's SecureRandom class allows attackers to defeat cryptographic protection mechanisms. When the nextBytes function is used with PHP 5.x without the paragonie/random_compat library and the openssl_random_pseudo_bytes function fails, the random numbers generated are not secure. This makes it easier for attackers to compromise the cryptographic operations performed by the application. The specific vectors through which this vulnerability can be exploited are unspecified.

How To Fix

Fixed versions by release line

The minimum fixed version depends on the release line you run.

  • >= 2.4.0, < 2.6.13 2.6.13
    composer require symfony/security-core:2.6.13
  • >= 2.7.0, < 2.7.9 2.7.9
    composer require symfony/security-core:2.7.9

Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →

Workaround

If updating Symfony is not immediately feasible, a workaround is to manually install the paragonie/random_compat library and ensure that the openssl_random_pseudo_bytes function is functioning correctly. This will provide secure random number generation even with PHP 5.x. Here is an example of how to install the library using Composer:

composer require paragonie/random_compat

Once the library is installed, ensure that the openssl_random_pseudo_bytes function is working as expected.

Conclusion

The Symfony Cryptographic Vulnerability (CVE-2016-1902) affects versions of Symfony before 2.3.37, 2.6.x before 2.6.13, and 2.7.x before 2.7.9. It allows attackers to defeat cryptographic protection mechanisms by exploiting the insecure random number generation. To fix this vulnerability, it is recommended to update Symfony to the fixed versions and ensure the use of PHP 7.x or higher. For further support on vulnerability remediation, contact DevNack.com.

See every vulnerability recorded for symfony/security-core →

Share this vulnerability

FAQ

Symfony is a PHP framework used for developing web applications. It provides a set of reusable components and tools that simplify the development process.

The SecureRandom class in Symfony is responsible for generating random numbers used for cryptographic operations.

Versions before 2.3.37, 2.6.x before 2.6.13, and 2.7.x before 2.7.9 are affected by this vulnerability.

The specific vectors through which this vulnerability can be exploited are unspecified.

The recommended fix is to update Symfony to version 2.3.37, 2.6.13, or 2.7.9, depending on the version being used. It is also recommended to use PHP 7.x or higher.

Related vulnerabilities

Recent vulnerabilities recorded for symfony/security-core.

How To Fix

Fixed versions by release line

The minimum fixed version depends on the release line you run.

  • >= 2.4.0, < 2.6.13 2.6.13
    composer require symfony/security-core:2.6.13
  • >= 2.7.0, < 2.7.9 2.7.9
    composer require symfony/security-core:2.7.9

Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback