CVE-2026-118658
Echo has Arbitrary Scheme Injection in WWWRedirect/NonWWWRedirect Middlewares via X-Forwarded-Proto
4.7
Description
Echo is a Go web framework. Prior to 4.15.2 and 5.1.1, Context.Scheme returns values from X-Forwarded-Proto, X-Forwarded-Protocol, or X-Url-Scheme without validating that they are supported web schemes. WWWRedirect and NonWWWRedirect use that value to construct a Location header, so an attacker controlling a forwarded scheme header can cause a redirect to use an arbitrary URI scheme. Exploitation requires an affected redirect middleware and user interaction with the response; the HTTPS-specific redirect variants hardcode HTTPS and are unaffected. This issue is fixed in 4.15.2 and 5.1.1.
Affected products and versions
| Product / package | Ecosystem / vendor | Versions | Fixed in | Source |
|---|---|---|---|---|
| github.com/labstack/echo/v5 | go | < 5.1.1 | 5.1.1 | GitHub |
| github.com/labstack/echo/v4 | go | < 4.15.2 | 4.15.2 | GitHub |