CVE-2021-4240: Phpservermon/phpservermon Insufficient Entropy Vulnerability
MODERATECVE-2021-4240 is a MODERATE (CVSS 5.3) insufficient entropy vulnerability (CWE-1241: Use of Predictable Algorithm in Random Number Generator) affecting Phpservermon/phpservermon libraries in the Packagist ecosystem. The issue involves insufficient entropy in phpservermon prng. Remediation is available by upgrading affected packages to version 3.6.0.
CVE-2021-4240 at a Glance
Security Impact
CVSS: 5.3
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N).
How to Fix CVE-2021-4240
To remediate this vulnerability, upgrade all affected Phpservermon/phpservermon dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade phpservermon/phpservermon to 3.6.0
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for phpservermon/phpservermon
How to Check if You Are Affected
To determine whether your application is affected by CVE-2021-4240, inspect your project dependencies for Phpservermon/phpservermon:
inspect dependencies for phpservermon/phpservermon
Analyze the terminal output to locate any version of Phpservermon/phpservermon in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.6.0), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-1241: Use of Predictable Algorithm in Random Number Generator, where the device uses an algorithm that is predictable and generates a pseudo-random number. In Phpservermon/phpservermon, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2021-4240 Affected Phpservermon/phpservermon Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
phpservermon/phpservermon
|
Packagist |
< 3.6.0
|
3.6.0
|
References
Frequently Asked Questions
What is CVE-2021-4240?
Which Phpservermon/phpservermon versions are affected?
What version fixes CVE-2021-4240?
Is phpservermon/phpservermon affected?
What is the CVSS score of CVE-2021-4240?
What CWE is associated with CVE-2021-4240?
How can I check Packagist dependencies for CVE-2021-4240?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-97w9-gcc7-vr8g",
"modified" : "2023-07-19T19:58:50Z",
"published" : "2022-11-16T12:00:20Z",
"aliases" : [ "CVE-2021-4240" ],
"summary" : "Insufficient Entropy in PHPServerMon PRNG",
"details" : "A vulnerability, which was classified as problematic, was found in phpservermon. This affects the function `generatePasswordResetToken` of the file `src/psm/Service/User.php`. The manipulation leads to use of predictable algorithm in random number generator. The exploit has been disclosed to the public and may be used. The name of the patch is 3daa804d5f56c55b3ae13bfac368bb84ec632193. It is recommended to apply a patch to fix this issue. The identifier VDB-213717 was assigned to this vulnerability.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Packagist",
"name" : "phpservermon/phpservermon"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "3.6.0"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-4240"
}, {
"type" : "WEB",
"url" : "https://github.com/phpservermon/phpservermon/commit/3daa804d5f56c55b3ae13bfac368bb84ec632193"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/phpservermon/phpservermon"
}, {
"type" : "WEB",
"url" : "https://huntr.dev/bounties/2-phpservermon/phpservermon"
}, {
"type" : "WEB",
"url" : "https://vuldb.com/?id.213717"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-1241", "CWE-330", "CWE-331" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2023-07-07T19:27:56Z",
"nvd_published_at" : "2022-11-15T23:15:00Z"
}
}