GHSA-h7wr-284f-5qvc: Go/github.com/labstack/echo/v4 vulnerability

Published Oct 23, 2026
·
Updated

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.

Affected Software

1 affected componentFixes available
go/github.com/labstack/echo/v4>=4.0.0<4.16.1
4.16.1

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade go/github.com/labstack/echo/v4 to a version that resolves this vulnerability.

    Fixed in 4.16.1
  2. Upgrade

    Upgrade Echo v4 to a version that resolves this vulnerability.

    Fixed in v4.16.1
  3. Configuration

    Disable gzip request decompression on exposed routes.

    Echo v4 Decompress middleware gzip request decompression = disabled
  4. Configuration

    Place BodyLimit after Decompress so the application limit applies to decoded bytes.

    Echo v4 middleware BodyLimit middleware ordering = after Decompress
  5. Configuration

    Use DecompressConfig.MaxDecompressedSize to bound the decompressed request size; a value of -1 explicitly disables the limit.

    Echo v4 Decompress middleware DecompressConfig.MaxDecompressedSize = 100 MiB when zero
  6. Compensating control

    Apply request deadlines and concurrency limits to reduce denial-of-service exposure.

  7. Operational

    Ensure callers handle body-read errors when using streaming enforcement.

Event History

Oct 23, 2026
Advisory Published
via GitHub·08:49 PM
Data Sourced
via GitHub·08:49 PM
DescriptionWeaknessAffected Software

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203