CVE-2026-118263: Echo: BodyDump can discard BodyLimit overflow errors for unknown-length requests
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.
Published Oct 23, 2026 · Updated Oct 28, 2026
Affected packages
github.com/labstack/echo/v5
- Ecosystem
- Go
- Affected
- >= 5.0.0, < 5.4.1
- Fixed in
- 5.4.1
- Check
go list -m github.com/labstack/echo/v5
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
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. 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.
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.
Credited to Duodum.
References
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology
More Go vulnerabilities
All Go entriesCVE-2026-118266
Echo has CSRF Protection Bypass via MethodOverride Rewriting POST to Safe Method
medium5.3Oct 28, 2026CVE-2026-118650
Echo's middleware.Static: `%2F`-encoded path bypasses route/group middleware guarding a statically-served path
high7.5Oct 28, 2026CVE-2026-118651
Echo: Reverse Proxy Forwards Attacker-Supplied X-Real-IP to Upstream by Default
medium5.3No fixOct 28, 2026CVE-2026-118652
Echo vulnerable to Reflected Cross-Site Scripting (XSS) via unsanitized JSONP callback in Context.JSONP / Context.JSONPBlob
medium6.1Oct 28, 2026CVE-2026-118653
Echo has Rate Limiter Bypass via Spoofed X-Forwarded-For Header in Default Configuration
medium5.3No fixOct 28, 2026CVE-2026-118654
Echo static file middleware route protection bypass via encoded dot-dot traversal
medium5.9Oct 28, 2026
