Skip to main content

CVE-2025-2814: CWE-338 Use of Cryptographically Weak Pseudo-Random Number Generator (PRNG) in LDS Crypt::CBC

Medium
VulnerabilityCVE-2025-2814cvecve-2025-2814cwe-338cwe-329cwe-331
Published: Sat Apr 12 2025 (04/12/2025, 23:41:48 UTC)
Source: CVE Database V5
Vendor/Project: LDS
Product: Crypt::CBC

Description

Crypt::CBC versions between 1.21 and 3.05 for Perl may use the rand() function as the default source of entropy, which is not cryptographically secure, for cryptographic functions. This issue affects operating systems where "/dev/urandom'" is unavailable.  In that case, Crypt::CBC will fallback to use the insecure rand() function.

AI-Powered Analysis

AILast updated: 09/05/2025, 20:13:26 UTC

Technical Analysis

CVE-2025-2814 identifies a cryptographic weakness in the Perl module Crypt::CBC versions between 1.21 and 3.05. Specifically, the vulnerability arises from the use of the standard rand() function as the default entropy source for cryptographic operations when the operating system does not provide a secure random number generator such as /dev/urandom. The rand() function is not designed to be cryptographically secure and can produce predictable pseudo-random numbers, which undermines the security of cryptographic keys or initialization vectors generated by Crypt::CBC. This weakness is classified under CWE-338 (Use of Cryptographically Weak PRNG), with related concerns in CWE-329 (Not Using a Random IV with CBC Mode) and CWE-331 (Insufficient Entropy). The vulnerability primarily affects environments where /dev/urandom is unavailable, which may include certain embedded systems, legacy operating systems, or restricted containerized environments. Exploiting this flaw could allow an attacker to predict cryptographic values, potentially leading to weakened encryption, ciphertext manipulation, or other cryptographic attacks. The CVSS 3.1 base score is 4.0 (medium), reflecting that the attack vector requires local access (AV:L), low attack complexity (AC:L), no privileges (PR:N), and no user interaction (UI:N). The impact is limited to availability (A:L), indicating potential denial of service or failure in cryptographic operations rather than direct confidentiality or integrity compromise. No known exploits are reported in the wild, and no patches are currently linked, suggesting the vulnerability is newly disclosed or under active assessment.

Potential Impact

For European organizations, the impact of this vulnerability depends on the deployment context of Crypt::CBC in Perl-based applications, especially those running on operating systems lacking /dev/urandom. Organizations using legacy or specialized systems (e.g., embedded devices, certain industrial control systems, or constrained environments) may be at higher risk. The use of a weak PRNG can lead to predictable cryptographic outputs, which could allow attackers with local access to compromise the reliability of encryption, potentially causing service disruptions or enabling further cryptographic attacks. Although the CVSS score indicates limited impact on confidentiality and integrity, the availability impact could affect critical services relying on secure cryptographic operations. This is particularly relevant for sectors such as finance, healthcare, and critical infrastructure in Europe, where Perl is still used in legacy systems or automation scripts. Additionally, the lack of secure entropy sources in some environments may be more prevalent in certain operational contexts, increasing exposure. However, since exploitation requires local access and the absence of /dev/urandom, the overall risk to large-scale internet-facing services is limited.

Mitigation Recommendations

European organizations should first identify all instances of Crypt::CBC usage in their Perl environments, especially versions between 1.21 and 3.05. They should verify the operating system's availability of secure entropy sources like /dev/urandom. If /dev/urandom is unavailable, organizations should consider the following mitigations: 1) Upgrade Crypt::CBC to a version that explicitly uses a cryptographically secure PRNG or patches this vulnerability once available. 2) Where upgrading is not immediately possible, implement custom entropy sources or wrappers to ensure secure random number generation, such as integrating with CPAN modules that provide secure randomness (e.g., Crypt::Random). 3) Restrict local access to systems running vulnerable versions to trusted personnel only, minimizing the risk of local exploitation. 4) Conduct code audits to ensure that cryptographic keys and IVs are not generated using insecure methods. 5) For embedded or legacy systems, consider OS-level upgrades or configurations that provide secure entropy sources. 6) Monitor for updates from the vendor or CPAN security advisories and apply patches promptly. 7) Implement defense-in-depth by combining cryptographic best practices with system hardening and access controls.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.1
Assigner Short Name
CPANSec
Date Reserved
2025-03-26T13:51:26.476Z
Cvss Version
3.1
State
PUBLISHED

Threat ID: 684dd951a8c9212743820151

Added to database: 6/14/2025, 8:19:29 PM

Last enriched: 9/5/2025, 8:13:26 PM

Last updated: 10/1/2025, 1:25:33 PM

Views: 49

Actions

PRO

Updates to AI analysis are available only with a Pro account. Contact root@offseq.com for access.

Please log in to the Console to use AI analysis features.

Need enhanced features?

Contact root@offseq.com for Pro access with improved analysis and higher rate limits.

Latest Threats