All vulnerabilities

Go

CVE-2026-134754

anacrolix torrent has unbounded recursion in the bencode decoder that causes stack-overflow crash and CPU-exhaustion DoS

Severity
High 7.1
Published
30 Oct 2026
Last changed
23 Nov 2026
Added to UpHeron
23 Nov 2026
Fixed in
1.61.1-0.20260911233437-76452a2c8a2f, 1.62.0
Exploit chance
0.5% in the next 30 daysHigher than 41% of CVEs. EPSS by FIRST, 24 Nov 2026
Weakness
Uncontrolled recursion (CWE-674)Inefficient algorithmic complexity (CWE-407)
Attack
Over the network · No login needed · Needs someone to view a page or file
Attacker can
Take it down
CVSS vector
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N
Also known as
GHSA-2wrx-84qj-4pcg, GO-2026-6894
Sources
CVE Program, OSV.dev and GitHub

Description

anacrolix/torrent's bencode decoder (bencode/) applies no limit on the nesting depth of nested dictionaries and lists. Two distinct denial-of-service mechanisms follow from that single root cause, both reachable from a single crafted .torrent file or from metadata obtained from a peer on a magnet-link/v2 download:

  • Stack-overflow process crash. Decoder.readOneValue recurses once per nesting level with no depth bound. A .torrent whose info value is a list nested a few million levels deep (≈8 MB file) drives the recursion past the 1 GiB goroutine-stack limit and the process dies with an unrecoverable fatal error: stack overflow. 2. Quadratic CPU exhaustion. metainfo.FileTree.UnmarshalBencode (BitTorrent v2) re-parses each subtree at every level, making parse time grow ~O(n²). A v2 info dict with a ~30,000-level file tree (≈0.2 MB) takes ~66 s to decode; 60,000 levels exceeds 90 s of decode time.
From the GitHub Advisory Database, CC BY 4.0. Shortened; the full text is there.

Affected software

SoftwareAffected versions
github.com/anacrolix/torrentGo · osv:Go:github.com/anacrolix/torrent
  • Every version before 1.62.0
  • Every version before 1.61.1-0.20260911233437-76452a2c8a2f

About github.com/anacrolix/torrent

Vulnerabilities in github.com/anacrolix/torrent

In our list
3
Published in the last 12 months
3
Critical, last 12 months
0
High, last 12 months
2
Known exploited
0
Search the list for github.com/anacrolix/torrent

References