Go
CVE-2026-118657
Echo: HTTPS Redirect and HSTS Bypass via Unconditional Trust of Forwarded Scheme Headers
- Severity
- Medium 5.9
- Published
- 28 Oct 2026
- Last changed
- 5 Nov 2026
- Added to UpHeron
- 23 Nov 2026
- Fixed in
- 4.16.0, 5.4.0
- Exploit chance
- 0.2% in the next 30 daysHigher than 7% of CVEs. EPSS by FIRST, 24 Nov 2026
- Attack
- Over the network · Only under certain conditions · No login needed · Needs someone to click or open something
- Attacker can
- Read data · Change some data
- CVSS vector
CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:L/A:N- Also known as
- GHSA-2ffq-g2xg-c22p, GO-2026-6879
- Sources
- OSV.dev and GitHub
Description
Context.Scheme() unconditionally trusts four client-controlled HTTP headers to determine the request scheme, with no mechanism to configure trusted sources. This allows a remote unauthenticated attacker to bypass HTTPS redirect enforcement and suppress HSTS headers.
The trusted headers (checked in this order of precedence):
- X-Forwarded-Proto
- X-Forwarded-Protocol
- X-Forwarded-Ssl
- X-Url-Scheme
Scenario A — Directly exposed application (vulnerable by default): The Echo application listens on HTTP and is reachable directly by clients (no L7 proxy in front), or an attacker can bypass the proxy and reach the backend directly. In this case, the attacker has full control over all request headers. Sending X-Forwarded-Proto: https defeats the HTTPSRedirect middleware entirely — traffic stays on plaintext HTTP, enabling man-in-the-middle attacks.
Affected software
| Software | Affected versions |
|---|---|
github.com/labstack/echo/v4Go · osv:Go:github.com/labstack/echo/v4 |
|
github.com/labstack/echo/v5Go · osv:Go:github.com/labstack/echo/v5 |
|
About github.com/labstack/echo/v4
Vulnerabilities in github.com/labstack/echo/v4
- In our list
- 10
- Published in the last 12 months
- 10
- Critical, last 12 months
- 0
- High, last 12 months
- 1
- Known exploited
- 0
- CVE-2026-118654Echo static file middleware route protection bypass via encoded dot-dot traversalMedium 5.9 28 Oct 2026
- CVE-2026-118655Echo has a Static Middleware Double-Unescape Path TraversalMedium 5.9 28 Oct 2026
- CVE-2026-118656Echo has Open Redirect via Control-Character Prefix Defeating sanitizeURIMedium 6.1 28 Oct 2026
- CVE-2026-118658Echo has Arbitrary Scheme Injection in WWWRedirect/NonWWWRedirect Middlewares via X-Forwarded-ProtoMedium 4.7 28 Oct 2026
- CVE-2026-118650Echo's middleware.Static: `%2F`-encoded path bypasses route/group middleware guarding a statically-served pathHigh 7.5 28 Oct 2026
- CVE-2026-118652Echo vulnerable to Reflected Cross-Site Scripting (XSS) via unsanitized JSONP callback in Context.JSONP / Context.JSONPBlobMedium 6.1 28 Oct 2026
About github.com/labstack/echo/v5
Vulnerabilities in github.com/labstack/echo/v5
- In our list
- 10
- Published in the last 12 months
- 10
- Critical, last 12 months
- 0
- High, last 12 months
- 1
- Known exploited
- 0
- CVE-2026-118654Echo static file middleware route protection bypass via encoded dot-dot traversalMedium 5.9 28 Oct 2026
- CVE-2026-118655Echo has a Static Middleware Double-Unescape Path TraversalMedium 5.9 28 Oct 2026
- CVE-2026-118656Echo has Open Redirect via Control-Character Prefix Defeating sanitizeURIMedium 6.1 28 Oct 2026
- CVE-2026-118658Echo has Arbitrary Scheme Injection in WWWRedirect/NonWWWRedirect Middlewares via X-Forwarded-ProtoMedium 4.7 28 Oct 2026
- CVE-2026-118650Echo's middleware.Static: `%2F`-encoded path bypasses route/group middleware guarding a statically-served pathHigh 7.5 28 Oct 2026
- CVE-2026-118652Echo vulnerable to Reflected Cross-Site Scripting (XSS) via unsanitized JSONP callback in Context.JSONP / Context.JSONPBlobMedium 6.1 28 Oct 2026
References
- CVE.org https://www.cve.org/CVERecord?id=CVE-2026-118657
- GitHub Advisory Database https://github.com/advisories/GHSA-2ffq-g2xg-c22p