Summary
Echo: WebSocket proxy can retain connections and handlers after client disconnect
Affected versions and patch
Affected versions are v4.15.0 through v4.16.0 and v5.0.0 through v5.4.0. The regression was introduced by commit e2133320c7, merged in #2852.
Upgrade to v4.16.1 or v5.4.1. The patch uses Go's HTTP reverse proxy, preserves ordinary HTTP handling for rejected upgrades, and closes both sides of a WebSocket tunnel when either direction ends. It also covers an upstream that receives client EOF but deliberately keeps its side open.
Workarounds
Disable WebSocket proxy routes until upgrading, or apply bounded connection lifetimes and resource limits at the frontend and upstream. Server idle timeouts alone may not cover hijacked WebSocket connections.
Credits
Reported by @irisitymichaelgrundberg.
Impact
Echo's Proxy middleware could retain a handler, copy goroutines and network connections after a WebSocket client disconnected if the upstream kept its connection open. The raw proxy waited for both copy directions to finish without reliably closing the other connection when one direction ended. Rejected upgrade responses with HTTP keep-alive were one way to trigger this behavior.
Repeated connections can accumulate resources and cause denial of service. The impact depends on the proxy route's accessibility, upstream behavior and configured connection deadlines. This is a medium-severity resource-retention issue; no confidentiality or integrity impact is claimed.
Affected versions
Security releases
Kodem intelligence
Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.
Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.
Already deployed Kodem?
See it in your environmentNew to Kodem? Get a demo →Remediation advice
github.com/labstack/echo/v4 to 4.16.1 or later; github.com/labstack/echo/v5 to 5.4.1 or later
Kodem Kai can prioritize this vulnerability in your dependency tree and generate a fix recommendation.
Frequently Asked Questions
- What is CVE-2026-118262? CVE-2026-118262 is a high-severity security vulnerability in github.com/labstack/echo/v4 (go), affecting versions >= 4.15.0, < 4.16.1. It is fixed in 4.16.1, 5.4.1.
- Which packages are affected by CVE-2026-118262?
github.com/labstack/echo/v4(go) (versions >= 4.15.0, < 4.16.1)github.com/labstack/echo/v5(go) (versions >= 5.0.0, < 5.4.1)
- Is there a fix for CVE-2026-118262? Yes. CVE-2026-118262 is fixed in 4.16.1, 5.4.1. Upgrade to this version or later.
- Is CVE-2026-118262 exploitable, and should I be worried? Whether CVE-2026-118262 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
- What actually determines whether CVE-2026-118262 is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
- How do I fix CVE-2026-118262?
- Upgrade
github.com/labstack/echo/v4to 4.16.1 or later - Upgrade
github.com/labstack/echo/v5to 5.4.1 or later
- Upgrade