Miggo Logo

CVE-2021-4241: PHPServerMon PRNG has Insufficient Entropy

5.3

CVSS Score
3.1

Basic Information

EPSS Score
0.33481%
Published
11/16/2022
Updated
7/19/2023
KEV Status
No
Technology
TechnologyPHP

Technical Details

CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N
Package NameEcosystemVulnerable VersionsFirst Patched Version
phpservermon/phpservermoncomposer< 3.6.03.6.0

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability stems from the use of mt_rand() in the token generation process within newRememberMeCookie. The commit bb10a5f explicitly replaces mt_rand with cryptographically secure random_bytes(64), addressing CWE-1241 (Predictable RNG). While setUserLoggedIn is mentioned in vulnerability descriptions, the actual vulnerable implementation was in newRememberMeCookie which it calls. The high confidence comes from: 1) Direct match between patched code location and vulnerability description 2) mt_rand() being a well-known insecure PRNG 3) Explicit CWE mapping to predictable RNG usage in the commit message.

Vulnerable functions

Only Mi**o us*rs **n s** t*is s**tion

WAF Protection Rules

WAF Rule

* vuln*r**ility, w*i** w*s *l*ssi*i** *s pro*l*m*ti*, w*s *oun* in p*ps*rv*rmon. *****t** is t** *un*tion `s*tUs*rLo****In` o* t** *il* `sr*/psm/S*rvi**/Us*r.p*p`. T** m*nipul*tion l***s to us* o* pr**i*t**l* *l*orit*m in r*n*om num**r **n*r*tor. T**

Reasoning

T** vuln*r**ility st*ms *rom t** us* o* mt_r*n*() in t** tok*n **n*r*tion pro**ss wit*in n*wR*m*m**rM**ooki*. T** *ommit ******* *xpli*itly r*pl***s mt_r*n* wit* *rypto*r*p*i**lly s**ur* r*n*om_*yt*s(**), ***r*ssin* *W*-**** (Pr**i*t**l* RN*). W*il*