GHSA-h7wr-284f-5qvc

Suggest an improvement
Source
https://github.com/advisories/GHSA-h7wr-284f-5qvc
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/10/GHSA-h7wr-284f-5qvc/GHSA-h7wr-284f-5qvc.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-h7wr-284f-5qvc
Published
2026-10-23T20:49:49Z
Modified
2026-10-23T21:00:04Z
Severity
  • 8.2 (High) CVSS_V4 - CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N CVSS Calculator
Summary
Echo: Decompress permits unbounded gzip expansion in v4
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.

Database specific
{
    "cwe_ids":  [
        "CWE-400",
        "CWE-409"
    ],
    "github_reviewed":  true,
    "github_reviewed_at":  "2026-10-23T20:49:49Z",
    "nvd_published_at":  null,
    "severity":  "HIGH"
}
References

Affected packages

Go / github.com/labstack/echo/v4

Package

Name
github.com/labstack/echo/v4
View open source insights on deps.dev
Purl
pkg:golang/github.com/labstack/echo/v4

Affected ranges

Type
SEMVER
Events
Introduced
4.0.0
Fixed
4.16.1

Database specific

source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/10/GHSA-h7wr-284f-5qvc/GHSA-h7wr-284f-5qvc.json"