# Echo Decompress unbounded gzip expansion

Source: https://junglewise.ai/threats/echo-decompress-permits-unbounded-gzip-expansion-in-v4-4854c33a  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-10-23. Updated: 2026-10-24  
License: CC BY 4.0 with a link back

Severity: high · CVSS 4 · Published 2026-10-23

Echo is a popular web framework for the Go programming language. The optional Decompress middleware in Echo v4 fails to limit how much a gzip-compressed request can expand when decompressed, allowing attackers to send small compressed payloads that decompress to huge sizes. This can cause the application to exhaust memory or CPU, potentially bringing down the service through repeated or concurrent requests.

Technologies: [github.com/labstack/echo/v4 (Go)](https://junglewise.ai/threats/technologies/github-com-labstack-echo-v4), [Labstack Echo](https://junglewise.ai/threats/technologies/labstack-echo). Vendors: [Go](https://junglewise.ai/threats/vendors/go), [Labstack](https://junglewise.ai/threats/vendors/labstack).

## Quick answers

**Is This vulnerability exploited in the wild?** No. Junglewise Threat Intelligence has no report of This vulnerability being exploited in the wild.

**How severe is This vulnerability?** High severity, with a CVSS score of 4, published 23 October 2026.

**Which products and versions are affected?** github.com/labstack/echo/v4 (Go) >= 4.0.0, < 4.16.1, SEMVER:introduced=4.0.0,fixed=4.16.1; Labstack Echo 4.0.0 through 4.16.0, v4 through v4.16.0.

**Is there a fix for This vulnerability?** Yes. github.com/labstack/echo/v4 (Go): upgrade to 4.16.1 or later. Until then: Disable gzip request decompression on exposed routes, or place BodyLimit middleware after Decompress so application limits apply to decoded bytes. Apply suitable request deadlines and concurrency limits as well. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is This vulnerability attacked?** It is attacked over the network.

**Am I affected?** Check whether you run github.com/labstack/echo/v4 (Go) or Labstack Echo at an affected version. 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.

## How to fix

- github.com/labstack/echo/v4 (Go): upgrade to 4.16.1 or later

  ```sh
  go get github.com/labstack/echo/v4@v4.16.1
  ```


Disable gzip request decompression on exposed routes, or place BodyLimit middleware after Decompress so application limits apply to decoded bytes. Apply suitable request deadlines and concurrency limits as well.

## Technical details

Echo v4's Decompress middleware passes decompressed gzip request bodies to handlers without enforcing a size limit on the expanded output, creating a zip-bomb vulnerability (CWE-409). An attacker can send a small gzip-compressed request body that decompresses to a very large size, causing memory exhaustion or CPU overload in handlers that read or bind the body. The vulnerability affects all v4 versions through 4.16.0; the fix adds a MaxDecompressedSize configuration option defaulting to 100 MiB.

## Affected products

- labstack Echo 4.0.0 through 4.16.0

## Timeline

- 2026-10-23: disclosed: Advisory published
- 2026-10-23: patched: v4.16.1 released with MaxDecompressedSize limit

## References

- [https://github.com/labstack/echo/security/advisories/GHSA-h7wr-284f-5qvc](https://github.com/labstack/echo/security/advisories/GHSA-h7wr-284f-5qvc)
- [https://github.com/labstack/echo/pull/3136](https://github.com/labstack/echo/pull/3136)

## Related threats

- [Echo web framework arbitrary URI scheme redirect](https://junglewise.ai/threats/cve-2026-118658-echo-is-a-go-web-framework-prior-to-4-15-2-and-5-1-1-context)
- [Echo Go web framework scheme header spoofing and HSTS bypass](https://junglewise.ai/threats/cve-2026-118657-echo-is-a-go-web-framework-prior-to-4-16-0-and-5-4-0-context)
- [Echo open redirect in sanitizeURI with trailing slash redirect](https://junglewise.ai/threats/cve-2026-118656-echo-is-a-go-web-framework-prior-to-4-16-0-and-5-4-0-sanitizeuri)
- [Echo path traversal via double URL encoding in Static middleware](https://junglewise.ai/threats/cve-2026-118655-echo-is-a-go-web-framework-prior-to-4-15-3-and-5-2-0-middleware)
- [Echo path traversal in static file handlers via dot segment normalization](https://junglewise.ai/threats/cve-2026-118654-echo-is-a-go-web-framework-prior-to-4-16-0-and-5-4-0-echo-s)
