{"id":"GHSA-h7wr-284f-5qvc","kind":"vulnerability","aliases":["GHSA-h7wr-284f-5qvc"],"related":[],"title":"Echo: Decompress permits unbounded gzip expansion in v4","description":"## Impact\n\nEcho 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.\n\nThe 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.\n\n## Affected versions and patch\n\nEcho v4 versions through v4.16.0 are affected. Upgrade to [v4.16.1](https://github.com/labstack/echo/releases/tag/v4.16.1).\n\nThe 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.\n\n[Fix commit](https://github.com/labstack/echo/commit/3fb0ba7e17645bb65611e2a08875d0a2f65c421f).\n\n## Workarounds\n\nDisable 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.\n\n## Credits\n\nReported by @q490107865. The exact-limit behavior incorporates @Shubham-Padkonde's work in [#3136](https://github.com/labstack/echo/pull/3136).","summary":"The Echo v4 Decompress middleware does not limit how large a gzip request body can grow when decoded. A small compressed request can expand into a very large body that exhausts server memory or CPU, causing denial of service.","severity":"high","cvss":null,"epss":null,"exploited":false,"exploited_at":null,"products":[{"name":"github.com/labstack/echo/v4","fixed":["4.16.1"],"affected":">= 4.0.0, < 4.16.1","ecosystem":"go"}],"ecosystems":["go"],"tags":["api-servers","cwe-400","cwe-409","echo","go","package","self-hosted"],"not_affected_if":["body-limit-after-decompress","default-config","middleware-not-enabled"],"how_to_check":"Check go.mod for github.com/labstack/echo/v4 at a version below 4.16.1 (go list -m github.com/labstack/echo/v4).\nSearch the code for middleware.Decompress() or echo.DecompressConfig to see whether the middleware is enabled.","fix":"Upgrade github.com/labstack/echo/v4 to v4.16.1 or later.\nAlternatively, disable gzip request decompression on exposed routes, or place BodyLimit after Decompress so the limit applies to decoded bytes.","status":"open","published_at":"2026-10-23T20:49:49+00:00","first_seen_at":"2026-10-23T20:59:05+00:00","triaged_at":"2026-10-23T21:00:33+00:00","updated_at":"2026-10-23T21:00:33+00:00","category":"package","confidence":0.9,"triage":{"at":"2026-10-23T21:00:33Z","model":"claude-haiku-5-5","output":{"fix":"Upgrade github.com/labstack/echo/v4 to v4.16.1 or later.\nAlternatively, disable gzip request decompression on exposed routes, or place BodyLimit after Decompress so the limit applies to decoded bytes.","reach":"internet","impact":"medium","summary":"The Echo v4 Decompress middleware does not limit how large a gzip request body can grow when decoded. A small compressed request can expand into a very large body that exhausts server memory or CPU, causing denial of service.","category":"package","who_cares":["go","echo","self-hosted","api-servers"],"confidence":0.9,"needs_auth":"no","worst_case":"Remote request exhausts server memory or CPU, causing denial of service.","analyst_note":"","how_to_check":"Check go.mod for github.com/labstack/echo/v4 at a version below 4.16.1 (go list -m github.com/labstack/echo/v4).\nSearch the code for middleware.Decompress() or echo.DecompressConfig to see whether the middleware is enabled.","needs_analyst":false,"not_affected_if":["default-config","middleware-not-enabled","body-limit-after-decompress"],"user_interaction":"no","needs_special_setup":"yes","severity_if_unknown":"high"},"cost_usd":0.000552,"input_tokens":3318,"output_tokens":440,"severity_before":"high"},"analyst_status":null,"analyst_note":null,"search":"'-1':194C '-400':26B '-409':28B '/labstack/echo/commit/3fb0ba7e17645bb65611e2a08875d0a2f65c421f).':235C '/labstack/echo/pull/3136).':285C '/labstack/echo/releases/tag/v4.16.1).':180C '/labstack/echo/v4':21A '100':187C '284f':12A,17A '3136':282C '413':206C '5qvc':13A,18A 'add':183C 'affect':164C,174C 'alon':144C 'alreadi':153C 'api':23B 'api-serv':22B 'appli':154C,253C,257C 'applic':151C,251C 'behavior':274C 'beyond':200C 'bind':111C,212C 'bodi':48B,63B,106C,113C,157C,213C,228C 'body-read':227C 'bodylimit':246C 'bound':147C 'byte':256C 'caller':224C 'cap':202C 'caus':70B,126C 'commit':232C 'compress':55B,97C,141C 'concurr':123C,262C 'configur':217C 'consum':115C 'could':99C,114C,125C 'cpu':69B,119C 'credit':266C 'cwe':25B,27B 'deadlin':260C 'decod':52B,87C,105C,255C 'decompress':2A,38B,81C,149C,160C,240C,248C 'decompressconfig.maxdecompressedsize':184C 'default':136C,185C 'denial':71B,127C 'disabl':196C,237C 'echo':1A,29B,36B,75C,168C 'effect':156C 'enabl':134C 'enforc':222C 'error':230C 'errstatusrequestentitytoolarg':204C 'exact':214C,272C 'exact-limit':271C 'excess':116C 'exhaust':65B 'expand':58B,93C 'expans':6A 'explicit':195C 'expos':83C,242C 'exposur':163C 'fix':231C 'ghsa':10A,15A 'ghsa-h7wr-284f-5qvc':9A,14A 'github.com':20A,179C,234C,284C 'github.com/labstack/echo/commit/3fb0ba7e17645bb65611e2a08875d0a2f65c421f).':233C 'github.com/labstack/echo/pull/3136).':283C 'github.com/labstack/echo/releases/tag/v4.16.1).':178C 'github.com/labstack/echo/v4':19A 'go':30B 'grow':50B 'gzip':5A,46B,86C,238C 'gzip-decod':85C 'h7wr':11A,16A 'handl':226C 'handler':107C 'host':34B 'http':205C 'impact':74C 'includ':207C 'incorpor':275C 'json':209C 'larg':44B,62B,104C 'limit':42B,91C,138C,158C,198C,218C,252C,263C,273C 'memori':67B,117C 'mib':188C 'middlewar':39B,82C,131C 'opt':79C 'opt-in':78C 'packag':31B 'padkond':278C 'patch':167C,182C 'permit':3A 'place':245C 'produc':101C 'q490107865':269C 'read':109C,199C,229C 'reduc':162C 'remain':219C 'repeat':121C 'report':267C 'request':47B,56B,88C,98C,124C,142C,239C,259C 'requir':223C 'return':203C 'rout':243C 'self':33B 'self-host':32B 'server':24B,66B 'servic':73B,129C 'shubham':277C 'shubham-padkond':276C 'size':94C,143C,150C 'small':54B,96C 'stream':89C,221C 'suitabl':258C 'therefor':100C 'unbound':4A 'upgrad':175C 'v4':8A,37B,76C,169C 'v4.16.0':172C 'v4.16.1':177C 'valid':220C 'valu':192C 'version':165C,170C 'well':265C 'without':90C 'work':280C 'workaround':236C 'xml':211C 'zero':190C","nicknames":[],"mitigations":[],"who_affected":null,"tier":"B","verified":{},"analyst_revisit_at":null,"first_public_at":"2026-10-23T20:49:49+00:00","kev":null,"cvss_vector":null,"cvss_by":null,"poc_count":0,"sources":[{"source":"ghsa","external_id":"GHSA-h7wr-284f-5qvc","url":"https://github.com/advisories/GHSA-h7wr-284f-5qvc","severity":"high","published_at":"2026-10-23T20:49:49+00:00","modified_at":"2026-10-23T20:49:50+00:00","first_seen_at":"2026-10-23T20:59:05+00:00","fetched_at":"2026-10-23T20:59:05+00:00","note":null}],"documents":[],"notice":"Free to read at a human pace. An API with keys and an MCP server are in preparation; early access: hello@infrastack.ai"}