CVE-2024-58041
📋 TL;DR
Smolder versions through 1.51 for Perl use the non-cryptographically secure rand() function for cryptographic operations, making generated values predictable. This affects all systems running vulnerable Smolder versions where cryptographic functions like password generation or token creation rely on this insecure randomness. Attackers could potentially predict or brute-force sensitive values.
💻 Affected Systems
- Smolder
📦 What is this software?
Smolder by Wonko
⚠️ Risk & Real-World Impact
Worst Case
Attackers predict cryptographic secrets like passwords, tokens, or session IDs, leading to authentication bypass, data compromise, or privilege escalation.
Likely Case
Predictable generation of non-critical random values reduces security of features like password reset tokens or temporary credentials.
If Mitigated
Limited impact if random values are only used for non-security purposes like test data generation.
🎯 Exploit Status
Exploitation requires understanding of how Smolder uses random values and ability to predict rand() output patterns.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: Not available
Vendor Advisory: Not available
Restart Required: No
Instructions:
1. Monitor Smolder releases for security updates
2. Consider replacing Data::Random with cryptographically secure alternatives
3. Review custom code using Smolder::DB::Developer
🔧 Temporary Workarounds
Replace Data::Random with Crypt::Random
allReplace insecure Data::Random usage with cryptographically secure Perl module
cpan install Crypt::Random
Replace 'use Data::Random;' with 'use Crypt::Random;' in affected files
Use Perl's cryptographically secure random
allReplace rand() calls with Crypt::Random::Secure or similar secure alternatives
cpan install Crypt::Random::Secure
Replace 'rand()' with 'Crypt::Random::Secure::rand()'
🧯 If You Can't Patch
- Isolate Smolder instances from sensitive systems and external access
- Implement additional authentication layers and monitor for suspicious activity
🔍 How to Verify
Check if Vulnerable:
Check Smolder version and examine lib/Smolder/DB/Developer.pm for Data::Random usage
Check Version:
perl -MSmolder -e 'print $Smolder::VERSION'
Verify Fix Applied:
Verify Data::Random is replaced with cryptographically secure module and rand() calls are removed
📡 Detection & Monitoring
Log Indicators:
- Unusual authentication patterns
- Predictable token generation sequences
Network Indicators:
- Repeated failed authentication with predictable patterns
SIEM Query:
Not applicable - requires application-level monitoring
🔗 References
- https://metacpan.org/release/BAREFOOT/Data-Random-0.13/source/lib/Data/Random.pm#L537
- https://metacpan.org/release/WONKO/Smolder-1.51/source/lib/Smolder/DB/Developer.pm#L221
- https://metacpan.org/release/WONKO/Smolder-1.51/source/lib/Smolder/DB/Developer.pm#L5
- https://perldoc.perl.org/functions/rand
- https://security.metacpan.org/docs/guides/random-data-for-security.html