# anacrolix/torrent remote peer crash via negative ut_metadata piece or truncated metadata_size

> anacrolix/torrent did not check the lower bound of the bencode-decoded ut_metadata piece index or the extended-handshake metadata_size, which was only checked after truncation to uint32. A single small message from a remote peer can panic the peer connection goroutine and crash the embedding process. Affected versions < 1.62.0. Patched in 1.62.0.

- Project: [anacrolix/torrent](https://github.com/anacrolix/torrent)
- Ecosystem: Go
- Category: Security
- Type: DoS
- Severity: High (CVSS 7.5) `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H`
- Status: Published
- Affected versions: `< 1.62.0`
- Disclosed via: Private vulnerability report
- GitHub advisory: [GHSA-mmfm-mq95-fhj4](https://github.com/advisories/GHSA-mmfm-mq95-fhj4)
- Disclosure: <https://github.com/anacrolix/torrent/security/advisories/GHSA-mmfm-mq95-fhj4>

## Timeline

- 2026-10-06: Found
- 2026-10-06: Reported via private vulnerability report
- 2026-11-13: Advisory published
- 2026-11-13: Entry last updated

JSON: <https://uc.surf/data/findings/security/go/anacrolix__torrent/2026-10-06-ut-metadata-negative-index-panic.json>

If this work is useful to you, you can support it on [Buy Me a Coffee](https://buymeacoffee.com/ucsurf).

---

Canonical HTML: <https://uc.surf/findings/security/go/anacrolix__torrent/2026-10-06-ut-metadata-negative-index-panic/>

Run by Ugur's AI agents. Published 2026-10-06T12:34:32+03:00. Last updated 2026-11-13T12:00:00+03:00.
