Vulnerabilities

Vulnerability · CVE-2026-118657

Echo: HTTPS Redirect and HSTS Bypass via Unconditional Trust of Forwarded Scheme Headers

Published Oct 28, 2026 · catalog updated Oct 28, 2026 · Echo: HTTPS Redirect and

Last checked Nov 4, 2026. A connected source was read within the last 7 days.

Check if you run it

No confirmed exploitation is on record for CVE-2026-118657. EPSS is 0.13%. Act only if a listed version of Echo: HTTPS Redirect and is installed.

Gaps on this record

  • The stored product name is a package slug. The name on this page is taken from the title (Echo: HTTPS Redirect and).
  • No vendor fix or required action is stored. Compare the linked advisory before you change production.
Severity
Medium5.9
Known exploitation
Not in CISA/VulnCheck KEV
EPSS
0.13%
Remediation
Advisory link
Affected products
Go github.com/labstack/echo/v4 · Go github.com/labstack/echo/v5 · golang github.com

## Description 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): 1. 2. 3. 4. ### Threat model **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 defeats the middleware entirely — traffic stays on plaintext HTTP, enabling man-in-the-middle attacks. This is the primary scenario. The application is vulnerable by default with no misconfiguration required — simply using as documented is sufficient. **Scenario B — Behind L7 proxy with header sanitization (reduced risk):** If the application is strictly behind a correctly configured L7 proxy that always overwrites and there is no direct access to the backend, the practical risk is lower. However, this relies on perimeter controls external to the framework, not on the framework itself. As Echo's own IP-extraction documentation states: *"you must not trust HTTP headers unconditionally."* ### Root cause , lines 161–181: Two additional issues with this implementation: 1. **No value validation.** returns any arbitrary string from the header, not just or . This breaks the documented contract ("returns the HTTP protocol scheme, or ") and causes unexpected behavior in middleware that uses the return value to construct URLs (e.g., builds ). 2. **Consumed by security-critical middleware.** The return value is used directly by redirect middleware ( ) and secure middleware ( ) for security enforcement decisions. ### Affected components | Component | File | Line(s) | Impact | |-----------|------|---------|--------| | | | 1

Are you affected?

Enter the version you run. The result uses only the ranges stored on this record.

The check returns affected, not affected, or incomplete. It does not guess a version that is missing from the record.

  • Go github.com/labstack/echo/v40 → 4.16.0
  • Go github.com/labstack/echo/v50 → 5.4.0
  • golang github.comversion unspecified

How to fix CVE-2026-118657

What to do

Three questions, each answered from this record only. Confirm the vendor advisory before you patch.

Should you patch?

No confirmed exploitation is on record for CVE-2026-118657. EPSS is 0.13%. Act only if a listed version of Echo: HTTPS Redirect and is installed.

Which versions are affected?

Compare what you have installed with 0 → 4.16.0, 0 → 5.4.0. Compare the installed version with the linked vendor advisory before you change production.

What should an analyst verify?

CWE-346. EPSS 0.13%. There is no CISA KEV listing. No Exploit-DB or Metasploit reference is linked. Use the source links for the original advisory.

Code

The project this record applies to. Exploit listings stay in References.

Timeline

Detection, updates, and resolution for this record.

  1. Oct 28, 2026 · GitLab Advisory Database

    Detected

    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

  2. Oct 28, 2026 · Go Vulnerability Database

    Fix available

    github.com/labstack/echo/v5 fixed in 5.4.0; github.com/labstack/echo/v4 fixed in 4.16.0

  3. Oct 28, 2026 · Go Vulnerability Database

    Fix available

    github.com/labstack/echo/v5 fixed in 5.4.0

  4. Oct 28, 2026 · Go Vulnerability Database

    Fix available

    github.com/labstack/echo/v4 fixed in 4.16.0

  5. Oct 28, 2026 · Go Vulnerability Database

    Updated

    ## Description 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): 1. 2. 3. 4. ### Threat model **Scenario A — Directly exposed application (vu

Sources

  • CVE.orgVulnerability recordCVE-2026-118657

    Official CVE identifier

    cve.org
  • FIRST EPSSExploitation probabilityCVE-2026-118657

    30-day exploitation probability 0.13%

    first.org
  • GitLab Advisory DatabasePackage advisoryCVE-2026-118657

    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

    advisories.gitlab.com
  • Go Vulnerability DatabasePackage advisoryGHSA-2ffq-g2xg-c22p

    Echo: HTTPS Redirect and HSTS Bypass via Unconditional Trust of Forwarded Scheme Headers

    osv.dev

References

Freshness

Last verified in this catalog Nov 4, 2026. Significant claims (KEV, EPSS, CVSS, affected ranges) come from the source rows above — open the original publisher for the authoritative advisory.

  • FIRST EPSSNov 4, 2026
  • Go Vulnerability DatabaseOct 30, 2026
  • GitLab Advisory DatabaseOct 30, 2026
  • CVE.orgOct 29, 2026