All vulnerabilities

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
Weakness
Origin validation error (CWE-346)
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.

From the GitHub Advisory Database, CC BY 4.0. Shortened; the full text is there.

Affected software

SoftwareAffected versions
github.com/labstack/echo/v4Go · osv:Go:github.com/labstack/echo/v4
  • Every version before 4.16.0
github.com/labstack/echo/v5Go · osv:Go:github.com/labstack/echo/v5
  • Every version before 5.4.0

About github.com/labstack/echo/v4

About github.com/labstack/echo/v5

References