Skip to main content
VulnerabilityPublished

github.com/anacrolix/torrent · Anacrolix Torrent Has Unbounded Recursion

Affects github.com/anacrolix/torrentSource GCVE Database

0

CVSS 6.5 Medium : upgrade to 1.61.1-0.20260911233437-76452a2c8a2f when convenient.

Data as of 31 Oct 2026, 02:07 UTC

CVSS 3.1 base score
6.5Medium
How severe the flaw is on the 0–10 CVSS scale.
Patch
Available – fixed in 1.61.1-0.20260911233437-76452a2c8a2f
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H

What to do

Upgrade github.com/anacrolix/torrent to 1.61.1-0.20260911233437-76452a2c8a2f.

Affected software

ProductAffectedFixed in
Gogithub.com/anacrolix/torrentAffected
  • <1.61.1-0.20260911233437-76452a2c8a2f
Fixed in
  • 1.61.1-0.20260911233437-76452a2c8a2f

Check your own hosts for these packages with threat-finder (opens in a new tab), our free open-source scanner.

AI-suggested

A patch is available in version 1.61.1-0.20260911233437-76452a2c8a2f that addresses these issues by adding recursion depth limits and optimizing the file tree parsing. Users and developers should upgrade to this fixed version to mitigate the vulnerabilities. Until patched, no effective mitigation exists because the decoder lacks any recursion depth limit and the metadata size limits allow exploitation. Monitoring or filtering untrusted .torrent files or metadata for excessive nesting is a potential but complex workaround.

Description

The anacrolix/torrent library's bencode decoder lacks any limit on the nesting depth of dictionaries and lists, leading to two denial-of-service vulnerabilities. First, deeply nested lists in a .torrent file can cause a stack overflow crash due to unbounded recursion, terminating the process. Second, the BitTorrent v2 file tree parser re-parses subtrees recursively in a quadratic time complexity manner, causing CPU exhaustion and process hang. These issues affect all applications embedding this library that process untrusted torrent metadata, including CLI tools and clients accepting magnet-link/v2 metadata. A fix is available in version 1.61.1-0.20260911233437-76452a2c8a2f.

References

Community reviews

Loading reviews…