# CVE-2024-57868: Web::API 2.8 and earlier for Perl uses insecure rand() function for cryptographic functions

- Severity: Medium 5.5 (CVSS:3.1, scored by CISA-ADP) `CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:L/I:L/A:L`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.31%, higher than 25% of CVEs (2026-12-01)
- Published: 2025-04-05T15:35:05.802Z
- Modified: 2026-06-17T08:14:06.990Z
- Weaknesses: CWE-331, CWE-338
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial
- Assigned by: 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.

(As written by CVE List.)

## Affected

- Web-API: up to 2.8
- lev web::api: up to 2.8

## References

- <https://perldoc.perl.org/functions/rand> (product)
- <https://security.metacpan.org/docs/guides/random-data-for-security.html> (product)
- <https://metacpan.org/release/BAREFOOT/Data-Random-0.13/source/lib/Data/Random.pm#L537> (product)
- <https://metacpan.org/dist/Web-API/source/lib/Web/API.pm#L20> (product)
- <https://metacpan.org/dist/Web-API/source/lib/Web/API.pm#L348> (product)

## Sources

- CVE List: [CVE-2024-57868](https://www.cve.org/CVERecord?id=CVE-2024-57868), CVE Terms of Use, modified 2025-09-05
- NVD: [CVE-2024-57868](https://nvd.nist.gov/vuln/detail/CVE-2024-57868), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2024-57868 · Whole record: https://cve.day/CVE-2024-57868.json · Rebuilt by cve.day 2026-11-25T22:58:52.480Z
