Unbounded gzip expansion in Echo v4 Decompress middleware
Key facts
- Attack vector
- —
- Privileges required
- —
- User interaction
- —
- Attack complexity
- —
- Impact type
- Denial of service
- Confidentiality · integrity · availability
- —
- Fix status
- Fixed
No CVSS vector from any source. Fix status from GitHub. Impact type from CWE-400.
Summary
The opt-in Decompress middleware in Echo v4 through v4.16.0 does not limit the expanded size of gzip-decoded request bodies. A small compressed request can produce a very large decoded body, which can exhaust memory or CPU in handlers that read or bind it. Repeated or concurrent requests can cause denial of service, but only when the middleware is enabled (CWE-400, CWE-409).
Written with Claude Haiku 5.5 from the sources below · 2026-10-28
Description from the GitHub advisory
## Impact Echo v4's opt-in Decompress middleware exposed a gzip-decoded request stream without limiting its expanded size. A small compressed request could therefore produce a very large decoded body. Handlers that read or bind that body could consume excessive memory or CPU, and repeated or concurrent requests could cause denial of service. The middleware is not enabled by default. A limit on the compressed request size alone does not bound the decompressed size. Applications that already apply an effective body limit after decompression have reduced exposure. ## Affected versions and patch Echo v4 versions through v4.16.0 are affected. Upgrade to [v4.16.1](https://github.com/labstack/echo/releases/tag/v4.16.1). The patch adds `DecompressConfig.MaxDecompressedSize`, defaulting to 100 MiB when zero. A value of `-1` explicitly disables the limit. Reading beyond the cap returns `ErrStatusRequestEntityTooLarge` (HTTP 413), including through JSON and XML binding. Bodies exactly at the configured limit remain valid. Streaming enforcement requires callers to handle body-read errors. [Fix commit](https://github.com/labstack/echo/commit/3fb0ba7e17645bb65611e2a08875d0a2f65c421f). ## Workarounds Disable gzip request decompression on exposed routes, or place BodyLimit after Decompress so the application limit applies to decoded bytes. Apply suitable request deadlines and concurrency limits as well. ## Credits Reported by @q490107865. The exact-limit behavior incorporates @Shubham-Padkonde's work in [#3136](https://github.com/labstack/echo/pull/3136).
Why it matters now
SSVC decision points
Not available: CISA has not published SSVC decision points for this record.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| — | github.com/labstack/echo/v4 (Go) | 4.0.0 to before 4.16.1 | 4.16.1 | Patch available | GHSA-h7wr-284f-5qvc |
- github.com/labstack/echo/v4 (Go) Vendor— Affected 4.0.0 to before 4.16.1 Fixed in 4.16.1 Patch available GHSA-h7wr-284f-5qvc
Remediation
Upgrade github.com/labstack/echo/v4 to version 4.16.1, which adds DecompressConfig.MaxDecompressedSize with a 100 MiB default. Until then, disable gzip request decompression on exposed routes or place BodyLimit after Decompress.
Written with Claude Haiku 5.5 from the sources below · 2026-10-28
- Fix · GHSA-h7wr-284f-5qvc github.com/labstack/echo/v4 (Go) Fixed in 4.16.1 Advisory →
Timeline
- 2026-10-23 Threatist record created from GHSA-h7wr-284f-5qvc
References
Sources
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences