CVE-2026-57082
Received Received - Intake

Weak MSE Key Generation in Net::BitTorrent

Vulnerability report for CVE-2026-57082, including description, CVSS score, EPSS score, affected products, exploitability, helpful resources, and attack-flow context.

Publication date: 2026-06-30

Last updated on: 2026-06-30

Assigner: CPANSec

Description

Net::BitTorrent versions through 2.0.1 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 Scores

EPSS Scores

Probability:
Percentile:

Meta Information

Published
2026-06-30
Last Modified
2026-06-30
Generated
2026-06-30
AI Q&A
2026-06-30
EPSS Evaluated
N/A
NVD
EUVD

Affected Vendors & Products

Showing 1 associated CPE
Vendor Product Version / Range
sanko net_bittorrent to 2.0.1 (inc)

Helpful Resources

Exploitability

CWE
CWE Icon
KEV
KEV Icon
CWE ID Description
CWE-338 The product uses a Pseudo-Random Number Generator (PRNG) in a security context, but the PRNG's algorithm is not cryptographically strong.
CWE-330 The product uses insufficiently random numbers or values in a security context that depends on unpredictable numbers.

Attack-Flow Graph

AI Quick Actions

Instant insights powered by AI
Executive Summary

CVE-2026-57082 affects the Net::BitTorrent Perl module versions up to 2.0.1. The vulnerability is in the Message Stream Encryption (MSE) handshake, where the Diffie-Hellman private key is generated using Perl's non-cryptographic rand() function. This function uses a predictable pseudo-random number generator (PRNG) seeded once per process, making the private key and derived encryption keys predictable.

A passive observer can capture the handshake's cleartext padding and public key, recover the PRNG state, reconstruct the private key, compute the shared secret, and derive the RC4 keys. This allows the observer to decrypt the entire connection, defeating the obfuscation that MSE is supposed to provide.

Impact Analysis

This vulnerability allows a passive attacker to decrypt the encrypted communication between peers using the Net::BitTorrent module. By reconstructing the private key and shared secret from predictable random values, the attacker can bypass the Message Stream Encryption's obfuscation.

As a result, sensitive data transmitted over the connection can be exposed to eavesdropping, potentially leading to privacy breaches or interception of information that was assumed to be protected.

Detection Guidance

This vulnerability can be detected by monitoring network traffic for the MSE handshake in Net::BitTorrent connections and analyzing the cleartext padding sent immediately after the public key and private-key draw. A passive observer can capture this padding to attempt to reconstruct the PRNG state.

To detect this on your system or network, you can capture traffic using tools like tcpdump or Wireshark and look for Net::BitTorrent MSE handshake packets containing cleartext padding after the public key.

  • Use tcpdump to capture traffic on the relevant port: tcpdump -i <interface> port <bittorrent_port> -w capture.pcap
  • Analyze the capture with Wireshark, filtering for MSE handshake packets and inspecting the cleartext padding fields.
  • Look for repeated or predictable patterns in the padding that indicate the use of a non-cryptographic PRNG.
Mitigation Strategies

Immediate mitigation involves updating the Net::BitTorrent Perl module to a version that replaces the non-cryptographic rand() function with a cryptographic random number generator.

Specifically, the fix replaces rand() with modules such as Crypt::URandom, Crypt::SysRandom, or Crypt::PRNG for generating the Diffie-Hellman private key and handshake padding.

Until an update is applied, consider restricting or monitoring BitTorrent traffic to reduce exposure to passive observers who could exploit this vulnerability.

Compliance Impact

This vulnerability allows a passive observer to decrypt the entire connection by predicting the Diffie-Hellman private key and derived encryption keys due to the use of a non-cryptographic PRNG. Such a compromise of confidentiality could lead to unauthorized access to sensitive data transmitted over the affected system.

As a result, organizations using the vulnerable Net::BitTorrent Perl module may face challenges in complying with data protection standards and regulations like GDPR and HIPAA, which require the protection of personal and sensitive information during transmission.

Failure to secure communications adequately could lead to violations of these regulations, potentially resulting in legal penalties, loss of trust, and other compliance-related consequences.

Chat Assistant

Ask questions about this CVE
Hi! I’m here to help you understand CVE-2026-57082. Ask me anything about the vulnerability, its impact, or mitigation strategies.
0/70

EPSS Chart