CVE-2025-1828

8.8 HIGH

📋 TL;DR

The Crypt::Random Perl package versions 1.05 through 1.55 may use the non-cryptographically secure rand() function for cryptographic operations when proper entropy sources are unavailable. This allows attackers to potentially predict or manipulate random values used in security-sensitive contexts like key generation, session tokens, or cryptographic operations. All systems using vulnerable versions of Crypt::Random on Windows (by default) or other platforms without /dev/urandom or EGD are affected.

💻 Affected Systems

Products:
  • Crypt::Random Perl module
Versions: 1.05 through 1.55
Operating Systems: All platforms, but Windows is most vulnerable due to default configuration
Default Config Vulnerable: ⚠️ Yes
Notes: Windows systems are vulnerable by default as they lack /dev/urandom. Other systems become vulnerable only when /dev/urandom and EGD are unavailable and no Provider is specified.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete compromise of cryptographic security leading to predictable encryption keys, session hijacking, authentication bypass, or data decryption by attackers who can predict the weak random values.

🟠

Likely Case

Degraded cryptographic security where attackers with sufficient resources could potentially predict or influence random values over time, compromising specific security functions that rely on Crypt::Random.

🟢

If Mitigated

Minimal impact if proper entropy sources are configured and available, or if the application doesn't use Crypt::Random for security-critical operations.

🌐 Internet-Facing: HIGH
🏢 Internal Only: MEDIUM

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: UNKNOWN
Unauthenticated Exploit: ✅ No
Complexity: MEDIUM

Exploitation requires understanding of the application's use of Crypt::Random and ability to predict or influence the weak random number generation. No public exploit code is known.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Version 1.56 or later

Vendor Advisory: https://github.com/perl-Crypt-OpenPGP/Crypt-Random/commit/1f8b29e9e89d8d083fd025152e76ec918136cc05

Restart Required: No

Instructions:

1. Update Crypt::Random to version 1.56 or later using CPAN: 'cpan Crypt::Random'
2. Alternatively, manually install from GitHub: clone repository and run 'perl Makefile.PL; make; make install'
3. Verify installation with 'perl -MCrypt::Random -e 'print $Crypt::Random::VERSION'

🔧 Temporary Workarounds

Explicitly specify secure Provider

all

Force Crypt::Random to use a cryptographically secure random source by explicitly setting the Provider parameter in code.

use Crypt::Random qw( makerandom );
my $random = makerandom( Provider => 'Win32' ); # For Windows
my $random = makerandom( Provider => 'dev/urandom' ); # For Unix-like

🧯 If You Can't Patch

  • Discontinue use of Crypt::Random for security-critical operations and replace with alternative cryptographically secure random number generators like Crypt::Random::Secure or Math::Random::Secure.
  • Ensure proper entropy sources (/dev/urandom on Unix-like systems, CryptGenRandom API on Windows) are available and configured for the system.

🔍 How to Verify

Check if Vulnerable:

Check installed Crypt::Random version: 'perl -MCrypt::Random -e "print \$Crypt::Random::VERSION"' - if output is between 1.05 and 1.55 inclusive, system is vulnerable.

Check Version:

perl -MCrypt::Random -e 'print $Crypt::Random::VERSION'

Verify Fix Applied:

After update, run version check command again - should show 1.56 or higher. Test random generation in a security context to ensure proper entropy sources are being used.

📡 Detection & Monitoring

Log Indicators:

  • Application errors related to random number generation failures
  • Warnings about unavailable entropy sources in application logs
  • Cryptographic operation failures or anomalies

Network Indicators:

  • None specific to this vulnerability - exploitation would manifest as successful cryptographic attacks

SIEM Query:

Search for application logs containing 'Crypt::Random' errors or warnings about random number generation, particularly on Windows systems or systems without /dev/urandom.

🔗 References

📤 Share & Export