Echo: BodyDump can discard BodyLimit overflow errors for unknown-length requests
影響パッケージ
| 種類 | パッケージ | 影響を受ける版 | 直った版 |
|---|---|---|---|
| labstack | echo | — | — |
| go | github.com/labstack/echo/v5 |
5.0.0 以上 5.4.1 未満 |
5.4.1 |
原文の説明 取得元が公開している説明をそのまま載せています (多くは英語)。
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.…
出典: CVE.org (CVE Program・cvelistV5) NVD GitHub Advisory