CVE-2026-57082: CWE-338 Use of Cryptographically Weak Pseudo-Random Number Generator (PRNG) in SANKO Net::BitTorrent
Net::BitTorrent versions before 2.1.0 for Perl generate the MSE Diffie-Hellman private key with a non-cryptographic PRNG. The MSE (Message Stream Encryption) handshake derives its 160-bit Diffie-Hellman private key from Perl's rand(), a non-cryptographic drand48-class generator seeded once per process, in KeyExchange.pm. The shared secret and the RC4 keys derived from it (the SHA-1 of "keyA" or "keyB", the shared secret, and the infohash) therefore depend entirely on a predictable PRNG. The same handshake sends, in cleartext, random padding drawn from the same rand() sequence in _random_pad, immediately after the public key and the private-key draw. A passive observer of the handshake recovers the PRNG state from the cleartext padding, reconstructs the private key, computes the shared secret from the peer's public key on the wire, derives the RC4 keys, and decrypts the connection, defeating the passive-observation obfuscation MSE provides.
AI Analysis
Technical Summary
Net::BitTorrent versions <=2.0.1 use Perl's rand(), a non-cryptographic drand48-class PRNG seeded once per process, to generate the 160-bit Diffie-Hellman private key for the MSE handshake in KeyExchange.pm. The handshake also sends random padding derived from the same PRNG in cleartext immediately after the public key and private key draw. An attacker passively observing the handshake can recover the PRNG state from the cleartext padding, reconstruct the private key, compute the shared secret using the peer's public key, derive the RC4 encryption keys, and decrypt the connection. This defeats the intended obfuscation provided by MSE and exposes the encrypted communication to passive interception.
Potential Impact
Confidentiality of the MSE-encrypted BitTorrent connection is compromised. An attacker who passively observes the handshake can decrypt the encrypted traffic by reconstructing the private key and shared secret. There is no impact on integrity or availability reported. The vulnerability allows passive decryption of the connection, undermining the privacy protections of MSE.
Mitigation Recommendations
Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. Users should upgrade to Net::BitTorrent version 2.1.0 or later, where this issue is resolved. Until then, avoid using affected versions (<=2.0.1) in environments where confidentiality of BitTorrent traffic is required.
CVE-2026-57082: CWE-338 Use of Cryptographically Weak Pseudo-Random Number Generator (PRNG) in SANKO Net::BitTorrent
Description
Net::BitTorrent versions before 2.1.0 for Perl generate the MSE Diffie-Hellman private key with a non-cryptographic PRNG. The MSE (Message Stream Encryption) handshake derives its 160-bit Diffie-Hellman private key from Perl's rand(), a non-cryptographic drand48-class generator seeded once per process, in KeyExchange.pm. The shared secret and the RC4 keys derived from it (the SHA-1 of "keyA" or "keyB", the shared secret, and the infohash) therefore depend entirely on a predictable PRNG. The same handshake sends, in cleartext, random padding drawn from the same rand() sequence in _random_pad, immediately after the public key and the private-key draw. A passive observer of the handshake recovers the PRNG state from the cleartext padding, reconstructs the private key, computes the shared secret from the peer's public key on the wire, derives the RC4 keys, and decrypts the connection, defeating the passive-observation obfuscation MSE provides.
CVSS v3.1
Score 5.9medium
Affected software
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
Net::BitTorrent versions <=2.0.1 use Perl's rand(), a non-cryptographic drand48-class PRNG seeded once per process, to generate the 160-bit Diffie-Hellman private key for the MSE handshake in KeyExchange.pm. The handshake also sends random padding derived from the same PRNG in cleartext immediately after the public key and private key draw. An attacker passively observing the handshake can recover the PRNG state from the cleartext padding, reconstruct the private key, compute the shared secret using the peer's public key, derive the RC4 encryption keys, and decrypt the connection. This defeats the intended obfuscation provided by MSE and exposes the encrypted communication to passive interception.
Potential Impact
Confidentiality of the MSE-encrypted BitTorrent connection is compromised. An attacker who passively observes the handshake can decrypt the encrypted traffic by reconstructing the private key and shared secret. There is no impact on integrity or availability reported. The vulnerability allows passive decryption of the connection, undermining the privacy protections of MSE.
Mitigation Recommendations
Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. Users should upgrade to Net::BitTorrent version 2.1.0 or later, where this issue is resolved. Until then, avoid using affected versions (<=2.0.1) in environments where confidentiality of BitTorrent traffic is required.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- CPANSec
- Date Reserved
- 2026-06-23T18:20:33.514Z
- Cvss Version
- null
- State
- PUBLISHED
- Remediation Level
- null
Threat ID: 6a43adde27e9c79719af49c1
Added to database: 06/30/2026, 11:51:58 UTC
Last enriched: 07/20/2026, 18:08:16 UTC
Last updated: 08/13/2026, 03:36:20 UTC
Views: 79
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.