CVE-2024-57868: Web::API 2.8 and earlier for Perl uses insecure rand() function for cryptographic functions
Timothy Legge 05 Apr 2025 15:36 UTC
========================================================================
CVE-2024-57868 CPAN Security Group
========================================================================
CVE ID: CVE-2024-57868
Distribution: Web-API
Versions: through 2.8
MetaCPAN: https://metacpan.org/dist/Web-API
Web::API 2.8 and earlier for Perl uses insecure rand() function for
cryptographic functions
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.
Problem types
-------------
CWE-338 Use of Cryptographically Weak Pseudo-Random Number Generator
(PRNG)
References
----------
https://perldoc.perl.org/functions/rand
https://security.metacpan.org/docs/guides/random-data-for-security.html
https://metacpan.org/release/BAREFOOT/Data-Random-0.13/source/lib/Data/Random.pm#L537
https://metacpan.org/dist/Web-API/source/lib/Web/API.pm#L20
https://metacpan.org/dist/Web-API/source/lib/Web/API.pm#L348
Credits
-------
Robert Rothenberg (RRWO), finder