{"vuln_id":"CVE-2026-134754","aliases":["GHSA-2wrx-84qj-4pcg"],"description":"anacrolix/torrent before 1.62.0 contains an uncontrolled recursion vulnerability in Decoder.readOneValue in bencode/decode.go that allows attackers to crash the process by supplying deeply nested bencode data. Attackers can deliver crafted .torrent files or magnet link metadata with millions of nested lists to cause a fatal stack overflow, or deeply nested v2 file trees to exhaust CPU.","published_at":"2026-10-30T22:55:09Z","modified_at":"2026-11-22T16:10:57.016837Z","first_seen_at":"2026-11-22T15:05:42.758095Z","severity":"high","severity_source":"nvd","cvss_score":7.1,"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/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X","cwe":["CWE-674","CWE-407"],"vendor":null,"product":null,"kev":{"is_kev":false,"date_added":null,"due_date":null,"ransomware":false},"epss":null,"epss_percentile":null,"nvd_status":"Received","enriched_at":"2026-11-22T15:29:15.493928Z","links":{"nvd":"https://nvd.nist.gov/vuln/detail/CVE-2026-134754"},"matched_alias":null,"items":[{"id":12853,"source":{"id":"nvd","name":"NVD CVE API 2.0"},"title":"CVE-2026-134754: anacrolix/torrent before 1.62.0 contains an uncontrolled recursion vulnerability in Decoder.readOneValue in bencode/decode.go that allows attackers to crash th…","summary":"anacrolix/torrent before 1.62.0 contains an uncontrolled recursion vulnerability in Decoder.readOneValue in bencode/decode.go that allows attackers to crash the process by supplying deeply nested bencode data. Attackers can deliver crafted .torrent files or magnet link metadata with millions of nested lists to cause a fatal stack overflow, or deeply nested v2 file trees to exhaust CPU.\n\nReferences:\nhttps://github.com/anacrolix/torrent/blob/v1.61.0/bencode/decode.go#L532-L591\nhttps://github.com/anacrolix/torrent/blob/v1.61.0/metainfo/file-tree.go#L35-L50\nhttps://github.com/anacrolix/torrent/commit/76452a2c8a2fd9c59d4d4f10fc3495723d538c7b\nhttps://github.com/anacrolix/torrent/releases/tag/v1.62.0\nhttps://github.com/anacrolix/torrent/security/advisories/GHSA-2wrx-84qj-4pcg\nhttps://pkg.go.dev/vuln/GO-2026-6894\nhttps://www.vulncheck.com/advisories/anacrolix-torrent-before-1.62.0-denial-of-service-via-bencode-decoder-recursion","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-134754","published_at":"2026-11-22T15:17:13.640000Z","updated_at":"2026-11-22T15:17:13.640000Z","fetched_at":"2026-11-22T16:33:57.007867Z","severity":"high","cvss_score":7.1,"epss":null,"is_kev":false,"has_exploit":false,"kev_due_date":null,"vendor":null,"product":null,"vuln_id":"CVE-2026-134754","vuln_ids":["CVE-2026-134754","GHSA-2WRX-84QJ-4PCG"],"tags":["CWE-674"],"cluster_id":11865,"links":{"self":"https://vulnwatch.ve1ve2.com/api/v1/items/12853","html":"https://vulnwatch.ve1ve2.com/item/12853"}},{"id":12827,"source":{"id":"vuldb","name":"VulDB recent entries"},"title":"CVE-2026-134754 | anacrolix torrent up to 1.61.x Bencode bencode/decode.go Decoder.readOneValue recursion","summary":"A vulnerability identified as problematic has been detected in anacrolix torrent up to 1.61.x. This vulnerability affects the function Decoder.readOneValue of the file bencode/decode.go of the component Bencode. The manipulation leads to uncontrolled recursion. This vulnerability is referenced as CVE-2026-134754. Remote exploitation of the attack is possible. No exploit is available. You should upgrade the affected component.","url":"https://vuldb.com/vuln/442116","published_at":"2026-11-22T14:40:37Z","updated_at":"2026-11-22T14:40:37Z","fetched_at":"2026-11-22T15:05:42.736436Z","severity":"high","cvss_score":7.1,"epss":null,"is_kev":false,"has_exploit":false,"kev_due_date":null,"vendor":"anacrolix","product":"torrent","vuln_id":"CVE-2026-134754","vuln_ids":["CVE-2026-134754","GHSA-2WRX-84QJ-4PCG"],"tags":["Vendor: anacrolix","Product: torrent","Type: Peer-to-Peer Software","Risk: problematic","Physical: No","Local: No","Remote: Yes","Exploit: No","Countermeasures: Upgrade"],"cluster_id":11865,"links":{"self":"https://vulnwatch.ve1ve2.com/api/v1/items/12827","html":"https://vulnwatch.ve1ve2.com/item/12827"}},{"id":14682,"source":{"id":"osv","name":"OSV.dev"},"title":"GO-2026-6894: anacrolix torrent has unbounded recursion in the bencode decoder that causes stack-overflow crash and CPU-exhaustion DoS in github.com/anacrolix/torrent","summary":"anacrolix torrent has unbounded recursion in the bencode decoder that causes stack-overflow crash and CPU-exhaustion DoS in github.com/anacrolix/torrent\n\nAffected: Go:github.com/anacrolix/torrent\n\nFixed in: 1.61.1-0.20260911233437-76452a2c8a2f\n\nReferences:\nhttps://github.com/anacrolix/torrent/security/advisories/GHSA-2wrx-84qj-4pcg\nhttps://github.com/anacrolix/torrent/commit/76452a2c8a2fd9c59d4d4f10fc3495723d538c7b","url":"https://osv.dev/vulnerability/GO-2026-6894","published_at":"2026-11-05T22:55:03Z","updated_at":"2026-11-22T16:10:57.016837Z","fetched_at":"2026-11-22T21:05:42.770128Z","severity":"high","cvss_score":7.1,"epss":null,"is_kev":false,"has_exploit":false,"kev_due_date":null,"vendor":null,"product":"github.com/anacrolix/torrent","vuln_id":"CVE-2026-134754","vuln_ids":["CVE-2026-134754","GHSA-2WRX-84QJ-4PCG","GO-2026-6894"],"tags":["osv","go","fix-available"],"cluster_id":11865,"links":{"self":"https://vulnwatch.ve1ve2.com/api/v1/items/14682","html":"https://vulnwatch.ve1ve2.com/item/14682"}},{"id":14681,"source":{"id":"osv","name":"OSV.dev"},"title":"GHSA-2wrx-84qj-4pcg: anacrolix torrent has unbounded recursion in the bencode decoder that causes stack-overflow crash and CPU-exhaustion DoS","summary":"anacrolix torrent has unbounded recursion in the bencode decoder that causes stack-overflow crash and CPU-exhaustion DoS ## Summary 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: 1. **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. Affected: every application embedding `github.com/anacrolix/torrent` that ingests attacker-supplied metainfo - the CLI tools (`cmd/torrent`, `cmd/torrent2`), any server that opens `.torrent` files, or any client that accepts metadata from a peer for a magnet/v2 download. No depth limit has ever existed in the decoder. ## Vulnerability Details All file:line references are against the pinned commit `4ad31c5170787215c51c6ddaa54abc06b623c11c`. ### Root cause - no recursion/depth limit in the bencode decoder `bencode/decode.go` implements three independently unbounded recursive parsers. There is no depth counter and no `MaxDepth`/nesting guard anywhere in `bencode/` or `metainfo/`. **Defect 1 - `readOneValue` recursion (`bencode/decode.go:546-549`)** ```go case 'd', 'l': // read until there is nothing to read for d.readOneValue() { } // <- recurses once per nested dict/list level, unbounded ``` `readOneValue` is invoked by `Decoder.parseUnmarshaler` (`bencode/decode.go:591`) whenever a decoded field implements `bencode.Unmarshaler`, which includes `bencode.Bytes` - the type of `MetaInfo.InfoBytes` (`metainfo/metainfo.go:17`). So decoding a normal `.torrent` routes the entire `info` value through this recursion. Stack usage is ~256 bytes per level (consistent with the observed ~4M-level crash at the 1 GiB goroutine-stack limit), so nesting `l` a few million levels deep exhausts the 1 GiB default goroutine-stack limit. Go's stack overflow is a `fatal error` - it is not a recoverable panic, so the `recover()` in `Decoder.Decode` (`bencode/decode.go:35-55`) cannot intercept it, and the whole process terminates. Entry points that reach `readOneValue` with attacker-controlled bytes: - `metainfo.Load` (`metainfo/metainfo.go:35`) / `metainfo.LoadFromFile` (`metainfo.go:50`) - decoding a `.torrent` file; the `info` value becomes a `bencode.Bytes` unmarshaler field. - `Client.AddTorrent` / `Client.AddTorrentFromFile` -> `metainfo.LoadFromFile` (`client.go:1776` inside `AddTorrentFromFile`) Affected: Go:github.com/anacrolix/torrent Fixed in: 1.61.1-0.20260911233437-76452a2c8a2f References: https://github.com/anacrolix/torrent/security/advisories/GHSA-2wrx-84qj-4pcg https://github.com/anacrolix/torrent/commit/76452a2c8a2fd9c59d4d4f10fc3495723d538c7b https://github.com/anacrolix/torrent","url":"https://osv.dev/vulnerability/GHSA-2wrx-84qj-4pcg","published_at":"2026-10-30T22:55:09Z","updated_at":"2026-11-22T16:10:57.016837Z","fetched_at":"2026-11-22T21:05:42.770127Z","severity":"high","cvss_score":7.1,"epss":null,"is_kev":false,"has_exploit":false,"kev_due_date":null,"vendor":null,"product":"github.com/anacrolix/torrent","vuln_id":"CVE-2026-134754","vuln_ids":["CVE-2026-134754","GHSA-2WRX-84QJ-4PCG","GO-2026-6894"],"tags":["osv","go","fix-available"],"cluster_id":11880,"links":{"self":"https://vulnwatch.ve1ve2.com/api/v1/items/14681","html":"https://vulnwatch.ve1ve2.com/item/14681"}}]}