HighGHSA-h7wr-284f-5qvcCVE-2026-118261GO-2026-6842

Echo: Decompress permits unbounded gzip expansion in v4

Published 23 Oct 2026 · Updated 5 Nov 2026

Is your project on an affected github.com/labstack/echo/v4?

Private repo? Upload its lockfile instead, or connect GitHub to check every repo.

Look after several Go apps? Indie watches up to 15 repos, private ones too, for $5 a month. See Indie

Affected package

Affected
>=4.0.0 <4.16.1
Fixed in
4.16.1
Update to the fixed version for your release line, for example:go get github.com/labstack/echo/v4@v4.16.1

Details

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.

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.

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.

Is GHSA-h7wr-284f-5qvc in any of your client repos?

Checking one package by hand is fine. Checking it across forty client projects is not. NPMscan reads the lockfiles in every GitHub repo you pick, finds each project with an affected github.com/labstack/echo/v4, and gives you the command that fixes it.

More advisories for github.com/labstack/echo/v4

  • LowCVE-2026-118653Rate Limiter Bypass via Spoofed X-Forwarded-For Header in Default Configuration in github.com/labstack/echo · 5 Nov 2026
  • LowCVE-2026-118650URL-encoded path bypasses route/group middleware guarding a statically-served path in github.com/labstack/echo · 5 Nov 2026
  • LowCVE-2026-118651Reverse Proxy Forwards Attacker-Supplied X-Real-IP to Upstream by Default in github.com/labstack/echo · 5 Nov 2026
  • LowCVE-2026-118652Cross-Site Scripting (XSS) via unsanitized JSONP callback in github.com/labstack/echo · 5 Nov 2026
  • LowCVE-2026-118266Echo has CSRF Protection Bypass via MethodOverride Rewriting POST to Safe Method in github.com/labstack/echo · 5 Nov 2026
  • LowCVE-2026-118658Arbitrary Scheme Injection in WWWRedirect/NonWWWRedirect Middlewares via X-Forwarded-Proto in github.com/labstack/echo · 5 Nov 2026
All 33 advisories for github.com/labstack/echo/v4

References

Advisory data from OSV.dev (opens OSV.dev in a new tab), refreshed daily.