CVE-2024-57868
published medium CVSS 3.1 · 5.5Web::API 2.8 and earlier for Perl uses insecure rand() function for cryptographic functions
Package status and fixes
| Distro / vendor | Release | Package / product | Publisher status | Fixed build | Source |
|---|---|---|---|---|---|
| LEV | — | Web-APIWeb::API · 0 through 2.8 · Other versions: unaffected | Affected | Not stated | CPANSec |
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.
Related advisories
Vendor advisories explicitly linked to this CVE.
No linked advisories were found for this CVE.
Assessment
CVSS risk assessment and additional context for this vulnerability.
- CVSS version
- 3.1
- Base score
- 5.5 / 10
- Severity
- medium
- Provider
- CISA-ADP · adp
- Vector string
- CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:L/I:L/A:L
Publisher product statements
Version ranges and default statuses as reported by each provider.
| Vendor | Product | Version status | Source |
|---|---|---|---|
| LEV | Web::API | 0 through 2.8 (affected · custom)Default: unaffected | CPANSec · cna |
Weaknesses
2- CWE-338 CWE-338 Use of Cryptographically Weak Pseudo-Random Number Generator (PRNG)
- CWE-331 CWE-331 Insufficient Entropy
References
5- https://metacpan.org/dist/Web-API/source/lib/Web/API.pm#L20
- https://metacpan.org/dist/Web-API/source/lib/Web/API.pm#L348
- https://metacpan.org/release/BAREFOOT/Data-Random-0.13/source/lib/Data/Random.pm#L537
- https://perldoc.perl.org/functions/rand
- https://security.metacpan.org/docs/guides/random-data-for-security.html
Provider assertions
2CPANSec · cna
Web::API 2.8 and earlier for Perl uses insecure rand() function for cryptographic functions
CISA-ADP · adp
CISA ADP Vulnrichment
Provenance
- Schema
- 5.1
- Searchable
- yes
- Content hash
- e42e2c62549085375dd6c6cdc157ebe4354cde6c5b6873a826fcbd2fb67429d1
- Ingested
- 23 Sep 2026, 08:32:14 UTC
- Source record
- Official CVE record