CVE-2021-3678: Use of Cryptographically Weak Pseudo-Random Number Generator in showdoc
5.9
CVSS Score
3.1
Basic Information
CVE ID
GHSA ID
EPSS Score
0.59412%
CWE
Published
9/2/2021
Updated
2/1/2023
KEV Status
No
Technology
PHP
Technical Details
CVSS Vector
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N
Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
---|---|---|---|
showdoc/showdoc | composer | < 2.9.8 | 2.9.8 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The commit diff shows both functions
originally used md5(time() + rand() + uniqid())
to generate secrets. PHP's rand()
and uniqid()
are not cryptographically secure, and combining them with a static string ('rgrsfsrfsrf') further weakens entropy. The fix replaced this with random_bytes()
, a CSPRNG. These two functions
directly handled cryptographic secret generation, making them the clear vulnerable points.