CVE-2024-57868 Details
Description
Web::API 2.8 and earlier for Perl uses the rand() function as the default source of entropy, which is not cryptographically secure, for cryptographic functions. Specifically Web::API uses the Data::Random library which specifically states that it is "Useful mostly for test programs". Data::Random uses the rand() function.
A vulnerability exists in Web::API versions through 2.8 for Perl, where the rand() function is used as the default source of entropy for cryptographic functions. This approach relies on a non-cryptographically secure random number generator, which can lead to predictable outcomes. The Data::Random library, utilized by Web::API, explicitly states its randomness is suitable only for testing purposes. This vulnerability could be exploited by generating predictable cryptographic tokens or keys, undermining security protocols that rely on such randomness.
Users can upgrade to Web::API versions later than 2.8, where this vulnerability has been addressed. Additionally, when using Web::API, it is recommended to manually set the 'api_key' attribute with a value generated by a cryptographically secure random number generator, such as Crypt::URandom or Crypt::SysRandom.
Metrics
CVSS 4.0 Severity and Vector Strings:
No CVSS 4.0 data is available for this CVE.
CVSS 3.x Severity and Vector Strings:
No data available for CVSS Version 2.0 on this CVE.
CISA-ADP
Assessed Apr 7, 2025References to Advisories, Solutions, and Tools
By selecting these links, you will be leaving this site. These are references gathered from the official CVE record and are not endorsed by Volerion.
| URL | Source(s) | Tag(s) |
|---|---|---|
| https://metacpan.org/dist/Web-API/source/lib/Web/API.pm#L20 | CPANSec | Product |
| https://metacpan.org/dist/Web-API/source/lib/Web/API.pm#L348 | CPANSec | Product |
| https://metacpan.org/release/BAREFOOT/Data-Random-0.13/source/lib/Data/Random.pm#L537 | CPANSec | Product |
| https://perldoc.perl.org/functions/rand | CPANSec | Product |
| https://security.metacpan.org/docs/guides/random-data-for-security.html | CPANSec | Product |
Weakness Enumeration
| CWE-ID | CWE Name | Source |
|---|---|---|
| CWE-338 | Use of Cryptographically Weak Pseudo-Random Number Generator (PRNG) | [email protected] |
| CWE-331 | Insufficient Entropy | CPANSec |
| CWE-338 | Use of Cryptographically Weak Pseudo-Random Number Generator (PRNG) | CPANSec |
Affected Products
| Product | Versions |
|---|---|
| lev web::api | <= 2.8 |
CPE
Remediation
| |
Change History
7 change records found show changes
| Date | Action | Recorded By |
|---|---|---|
| Jun 17, 2026 | CVE Modified | CISA-ADP |
| Jun 17, 2026 | CVE Modified | CPANSec |
| Nov 13, 2025 | Modified Analysis | [email protected] |
| Sep 5, 2025 | CVE Modified | CPANSec |
| Apr 9, 2025 | Initial Analysis | [email protected] |
| Apr 7, 2025 | CVE Modified | CISA-ADP |
| Apr 5, 2025 | New CVE Received | CPANSec |