CVE-2021-4240: Insufficient Entropy in PHPServerMon PRNG
5.3
CVSS Score
3.1
Basic Information
CVE ID
GHSA ID
EPSS Score
0.48943%
CWE
Published
11/16/2022
Updated
7/19/2023
KEV Status
No
Technology
PHP
Technical Details
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N
Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
---|---|---|---|
phpservermon/phpservermon | composer | < 3.6.0 | 3.6.0 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability stems from the pre-patch implementation of generatePasswordResetToken which used sha1(uniqid(mt_rand(), true)). mt_rand() is cryptographically insecure and produces predictable values. The commit 3daa804 explicitly replaces mt_rand with cryptographically secure random_bytes, and CWE-1241 specifically calls out 'Use of Predictable Algorithm in Random Number Generator'. The function's security-critical context (password reset tokens) combined with the documented fix confirms this as the vulnerable function.