Unchecked Return Value Affecting github.com/labstack/echo/v4/middleware package, versions <4.16.1


Severity

Recommended
0.0
medium
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

EPSS
0.39% (33rd percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk IDSNYK-GOLANG-GITHUBCOMLABSTACKECHOV4MIDDLEWARE-21817568
  • published29 Oct 2026
  • disclosed28 Oct 2026
  • creditDuodum

Introduced: 28 Oct 2026

NewCVE-2026-118263  (opens in a new tab)
CWE-252  (opens in a new tab)

How to fix?

Upgrade github.com/labstack/echo/v4/middleware to version 4.16.1 or higher.

Overview

github.com/labstack/echo/v4/middleware is a middleware package for echo.

Affected versions of this package are vulnerable to Unchecked Return Value via the BodyDump middleware in middleware/body_dump.go. An attacker can cause a handler to accept a truncated request despite the configured BodyLimit by sending an unknown-length, such as chunked, request that exceeds the BodyLimit threshold when BodyDump’s capture limit is smaller. BodyDump drains the remaining request body while ignoring read errors, discarding the overflow error before the handler processes the captured prefix.

Notes

  • The overflow-error suppression occurs when BodyLimit wraps BodyDump, so its limited reader is the one BodyDump drains; this middleware ordering is required for the described error-discard path.

Workarounds

  • Disable BodyDump on affected routes to prevent it from draining the request body and discarding the BodyLimit overflow error.
  • Set BodyDumpConfig.MaxRequestBytes above the enforced BodyLimit so the overflow is detected during BodyDump’s initial capture.

CVSS Base Scores

version 4.0
version 3.1