# CVE-2026-57082: Weak cryptography in Net::BitTorrent

> A passive attacker can decrypt BitTorrent traffic by predicting the Diffie-Hellman private key generated via a non-cryptographic PRNG in the Net::BitTorrent Perl library.

- **Severity:** Medium 5.9 (`CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** No
- **Published:** 30 Jun 2026
- **Updated:** 20 Jul 2026
- **Also known as:** GHSA-3x8p-9jc8-598w, GHSA-g444-x2c5-94hc

## What is CVE-2026-57082?

CVE-2026-57082 is a medium-severity vulnerability in SANKO Net::BitTorrent, published on 30 Jun 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official 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.

Weakness: CWE-338 (Use of Cryptographically Weak Pseudo-Random Number Generator (PRNG)), CWE-330 (Use of Insufficiently Random Values)

## Which versions are affected by CVE-2026-57082?


## How do I fix CVE-2026-57082?

No fix has been published for CVE-2026-57082 yet. Limit exposure of the affected software until one is available.

## Is CVE-2026-57082 being exploited?

There is no known exploitation of CVE-2026-57082 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-57082 and fix it if it is affected.

What it is: CVE-2026-57082 is a medium-severity vulnerability in SANKO Net::BitTorrent, published on 30 Jun 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2026-57082 in the wild and no public exploit code.

Affected product: SANKO Net::BitTorrent. No package-level version data is available, so check the vendor advisory linked from the reference page.

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2026-57082/ (Markdown: https://insights.sbomify.com/CVE-2026-57082/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2026-57082
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2026-57082
- OSV: https://osv.dev/vulnerability/CVE-2026-57082

---
From sbomify Insights: https://insights.sbomify.com/CVE-2026-57082/
Summaries are generated and may contain mistakes; the official description above is the record.
