BodyDump discards BodyLimit overflow errors in Echo v5
Key facts
- Attack vector
- —
- Privileges required
- —
- User interaction
- —
- Attack complexity
- —
- Impact type
- —
- Confidentiality · integrity · availability
- —
- Fix status
- Fixed
No CVSS vector from any source. Fix status from GitHub.
Summary
The BodyDump middleware in github.com/labstack/echo/v5 from 5.0.0 before 5.4.1 drains the remaining request body while ignoring read errors, so an overflow detected during that drain can be discarded (CWE-252). With an outer BodyLimit and an unknown-length request such as a chunked HTTP/1.1 request, a handler can process a truncated body and return success even though the original body exceeded the configured limit. This is a conditional size-policy bypass, with no general authentication bypass or denial of service claimed.
Written with Claude Haiku 5.5 from the sources below · 2026-10-28
Description from the GitHub advisory
## Impact Echo v5's BodyDump middleware captured a bounded prefix, drained the remaining request body while ignoring read errors, and then replaced the body with the captured prefix. With an outer BodyLimit, an unknown-length request such as an HTTP/1.1 chunked request, and a BodyDump capture limit below the BodyLimit threshold, an overflow detected during that drain could be discarded. The handler could consequently process a truncated request and return success even though the original body exceeded the configured limit. This is a conditional size-policy bypass; no general authentication bypass, production data modification or denial of service is claimed. Known-length requests rejected before BodyDump runs are unaffected by this path. ## Affected versions and patch All v5 releases from v5.0.0 through v5.4.0 contain the affected drain-and-replace logic. Runtime reproduction confirmed v5.4.0; source comparison confirms the same request handling in v5.0.0. Upgrade to [v5.4.1](https://github.com/labstack/echo/releases/tag/v5.4.1). BodyDump now captures only the configured prefix for logging and reconstructs the handler's reader from that prefix plus the unread original stream. It preserves the original closer and read errors instead of silently draining the rest. [Fix commit](https://github.com/labstack/echo/commit/1855061e572ae9dab727c811d8382f266bfbaaec). Streaming BodyLimit enforcement still requires the application to consume the request body and handle read errors. The BodyDump capture cap is a logging cap, not an application body limit. ## Workarounds Disable BodyDump on affected routes, or ensure the BodyLimit overflow is detected during the initial capture by setting the capture limit above the enforced body limit. Upgrading is recommended because it also preserves the complete body for handlers. ## Credits Reported by @Duodum. The fix incorporates @jakezwang's request-body preservation work in [#3105](https://github.com/labstack/echo/pull/3105).
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/v5 (Go) | 5.0.0 to before 5.4.1 | 5.4.1 | Patch available | GHSA-x9ff-22gv-65f4 |
- github.com/labstack/echo/v5 (Go) Vendor— Affected 5.0.0 to before 5.4.1 Fixed in 5.4.1 Patch available GHSA-x9ff-22gv-65f4
Remediation
Upgrade github.com/labstack/echo/v5 to 5.4.1, which captures only the configured prefix and preserves the original read errors. Until then, disable BodyDump on affected routes or set the BodyDump capture limit above the enforced body limit.
Written with Claude Haiku 5.5 from the sources below · 2026-10-28
- Fix · GHSA-x9ff-22gv-65f4 github.com/labstack/echo/v5 (Go) Fixed in 5.4.1 Advisory →
Timeline
- 2026-10-23 Threatist record created from GHSA-x9ff-22gv-65f4
References
Sources
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences