Vulnerabilities

Vulnerability · CVE-2026-118658

Echo has Arbitrary Scheme Injection in WWWRedirect/NonWWWRedirect Middlewares via X-Forwarded-Proto

Published Oct 28, 2026 · catalog updated Oct 28, 2026 · Echo has Arbitrary Scheme

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-118658. EPSS is 0.19%. Act only if a listed version of Echo has Arbitrary Scheme 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 has Arbitrary Scheme).
  • No vendor fix or required action is stored. Compare the linked advisory before you change production.
Severity
Medium4.7
Known exploitation
Not in CISA/VulnCheck KEV
EPSS
0.19%
Remediation
Advisory link
Affected products
Go github.com/labstack/echo/v4 · Go github.com/labstack/echo/v5 · golang github.com

## Summary The method in Echo ( ) trusts the , , and request headers without validating that the value is or . The and middlewares use this unsanitized scheme to construct redirect URLs, allowing an attacker to inject arbitrary URI schemes into the response header. ## Affected Components - - method returns attacker-controlled value verbatim - - / use unsanitized scheme ## Proof of Concept Confirmed injectable schemes: , , , , , , , . Only and (and variants) are affected. , , are NOT affected (they hardcode ). ## Impact - Open redirect to arbitrary scheme URLs when app is not behind a proxy that strips - Cache poisoning when behind a CDN that caches redirect responses keyed by path - scheme injection could trigger file access in some browser configurations ## Suggested Fix Whitelist scheme in to only return or : ## Disclosure Source code review, manually verified with actual HTTP server. Tested on Echo v5.0.4 (latest master). ## Patches Fixed in v5.1.1 and v4.15.2. now accepts only , , or from the , and headers, and falls back to for any other value (#2953). ## Workarounds Upgrade to a patched version. If you cannot upgrade, have your edge proxy overwrite or remove the , and request headers.

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.15.2
  • Go github.com/labstack/echo/v50 → 5.1.1
  • golang github.comversion unspecified

How to fix CVE-2026-118658

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-118658. EPSS is 0.19%. Act only if a listed version of Echo has Arbitrary Scheme is installed.

Which versions are affected?

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

What should an analyst verify?

CWE-601: URL Redirection to Untrusted Site (Open Redirect). EPSS 0.19%. 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

    The c.Scheme() method in Echo (context.go:162-181) trusts the X-Forwarded-Proto, X-Forwarded-Protocol, and X-Url-Scheme request headers without validating that the value is http or https. The WWWRedirect() and NonWWWRedirect() middlewares use this unsanitized scheme to construct redirect URLs, allowing an attacker to inject arbitrary URI schemes into the Location response header.

  2. Oct 28, 2026 · Go Vulnerability Database

    Fix available

    github.com/labstack/echo/v5 fixed in 5.1.1; github.com/labstack/echo/v4 fixed in 4.15.2

  3. Oct 28, 2026 · Go Vulnerability Database

    Fix available

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

  4. Oct 28, 2026 · Go Vulnerability Database

    Fix available

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

  5. Oct 28, 2026 · Go Vulnerability Database

    Updated

    ## Summary The method in Echo ( ) trusts the , , and request headers without validating that the value is or . The and middlewares use this unsanitized scheme to construct redirect URLs, allowing an attacker to inject arbitrary URI schemes into the response header. ## Affected Components - - method returns attacker-controlled value verbatim - - / use unsanitized scheme ## Proof of Concept Confirme

Sources

  • CVE.orgVulnerability recordCVE-2026-118658

    Official CVE identifier

    cve.org
  • FIRST EPSSExploitation probabilityCVE-2026-118658

    30-day exploitation probability 0.19%

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

    The c.Scheme() method in Echo (context.go:162-181) trusts the X-Forwarded-Proto, X-Forwarded-Protocol, and X-Url-Scheme request headers without validating that the value is http or https. The WWWRedirect() and NonWWWRedirect() middlewares use this unsanitized scheme to construct redirect URLs, allowing an attacker to inject arbitrary URI schemes into the Location response header.

    advisories.gitlab.com
  • GitLab Advisory DatabasePackage advisorygo/github.com/labstack/echo/v4/CVE-2026-118658.yml

    The method in Echo ( ) trusts the the value is or . The and middlewares use this unsanitized scheme to construct redirect URLs, allowing an attacker to inject arbitrary URI schemes into the response header." -date: "2026-10-28" +date: "2026-10-31" pubdate: "2026-10-28" affected_range: "<4.15.2" fixed_versions:

    gitlab.com
  • GitLab Advisory DatabasePackage advisorygo/github.com/labstack/echo/v5/CVE-2026-118658.yml

    The method in Echo ( ) trusts the the value is or . The and middlewares use this unsanitized scheme to construct redirect URLs, allowing an attacker to inject arbitrary URI schemes into the response header." -date: "2026-10-28" +date: "2026-10-31" pubdate: "2026-10-28" affected_range: "<5.1.1" fixed_versions:

    gitlab.com
  • Go Vulnerability DatabasePackage advisoryGHSA-23wf-92cp-8pcj

    Echo has Arbitrary Scheme Injection in WWWRedirect/NonWWWRedirect Middlewares via X-Forwarded-Proto

    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
  • GitLab Advisory DatabaseNov 1, 2026
  • GitLab Advisory DatabaseNov 1, 2026
  • Go Vulnerability DatabaseOct 30, 2026
  • GitLab Advisory DatabaseOct 30, 2026
  • CVE.orgOct 29, 2026