# CVE-2026-77640: Tor infinite loop in zlib/gzip decompression

Source: https://junglewise.ai/threats/cve-2026-77640-tor-infinite-loop-in-zlib-gzip-decompression  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-08-20. Updated: 2026-09-25  
License: CC BY 4.0 with a link back

CVE-2026-77640 · Severity: low · CVSS 3.7 · Published 2026-08-20

Tor, the anonymity network software, contained a vulnerability that could cause the application to hang indefinitely when processing truncated compressed data streams. An attacker could exploit this to cause a denial of service by sending specially crafted compressed data, potentially disrupting Tor's ability to relay traffic or communicate.

Technologies: [Torproject Tor](https://junglewise.ai/threats/technologies/tor). Vendors: [Torproject](https://junglewise.ai/threats/vendors/torproject).

## Quick answers

**Is CVE-2026-77640 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2026-77640 being exploited in the wild.

**How severe is CVE-2026-77640?** Low severity, with a CVSS score of 3.7, published 20 August 2026.

**Which products and versions are affected?** Tor Project Tor before 0.4.9.9.

**Is there a fix for CVE-2026-77640?** A patch was published on 2026-08-20: Fixed in version 0.4.9.9 Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2026-77640 attacked?** It is attacked over the network, in a hosted service.

**Am I affected by CVE-2026-77640?** Check whether you run Torproject Tor. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## Technical details

The vulnerability exists in Tor's decompression handling code (buf_add_compress function) when processing truncated zlib or gzip streams with the done flag set to 1. When a truncated stream cannot reach Z_STREAM_END, zlib returns Z_BUF_ERROR to signal no input remains, but the vulnerable code mistakenly interpreted this as indicating a full output buffer and retried the decompression indefinitely, causing an infinite loop. The fix returns TOR_COMPRESS_ERROR upon receiving Z_BUF_ERROR with no remaining input, allowing the caller to abort the operation cleanly. This affects Tor versions before 0.4.9.9 and can be triggered remotely by sending malformed compressed data over the network.

## Affected products

- Tor Project Tor before 0.4.9.9

## Timeline

- 2026-08-20: disclosed
- 2026-08-20: patched: Fixed in version 0.4.9.9

## References

- [https://gitlab.torproject.org/tpo/core/tor/-/raw/tor-0.4.9.9/ChangeLog](https://gitlab.torproject.org/tpo/core/tor/-/raw/tor-0.4.9.9/ChangeLog)

## Related threats

- [Tor out-of-bounds write in signature parsing](https://junglewise.ai/threats/cve-2026-77642-tor-out-of-bounds-write-in-signature-parsing)
- [Tor use-after-free in CONFLUX_SWITCH cell handling](https://junglewise.ai/threats/cve-2026-77641-tor-use-after-free-in-conflux-switch-cell-handling)
- [Tor compression bomb bypass in gzip/zlib stream handling](https://junglewise.ai/threats/cve-2026-77639-tor-compression-bomb-bypass-in-gzip-zlib-stream-handling)
- [Tor race condition in onion service rendezvous](https://junglewise.ai/threats/cve-2026-77638-tor-race-condition-in-onion-service-rendezvous)
- [Tor use-after-free in conflux object recovery](https://junglewise.ai/threats/cve-2026-77587-tor-use-after-free-in-conflux-object-recovery)
