CVE-2026-118658

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

Published Oct 28, 2026 CVSS 3.1 · 4.7 Medium EPSS < 1% KEV · Not listed
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.

Analysis

AI-generated

Technical impact

Echo is a Go web framework that builds redirect URLs using the scheme value from forwarded headers such as X-Forwarded-Proto, X-Forwarded-Protocol, or X-Url-Scheme. Before version 4.15.2 and 5.1.1, the framework does not validate that these headers contain supported web schemes. Consequently, an attacker who can control these headers can force the redirection middleware to generate a Location header with any URI scheme, including non‑HTTP schemes such as mailto: or other custom protocols. An unsuspecting user following the redirect would then be directed to a malicious endpoint, creating an open redirect vector that can be exploited for phishing or other social‑engineering attacks. This vulnerability is a classic CWE‑601 open redirect flaw.

Affected Systems

The flaw exists in Echo releases earlier than 4.15.2 and 5.1.1, affecting all deployments that use the WWWRedirect or NonWWWRedirect middlewares and rely on forwarded scheme headers. The issue is fixed in the cited release tags, so any component that has not been updated to at least those versions is vulnerable. Systems that do not employ these middlewares or that use the HTTPS‑specific redirect variants are not impacted.

Risk and Exploitability

The CVSS score of 4.7 indicates a moderate severity. The EPSS score is not available, and the vulnerability is not listed in the CISA KEV catalog. Based on the description, the likely attack vector is remote header injection through HTTP proxies or load balancers that set forwarded scheme headers. Exploitation requires an affected redirect middleware and user interaction with the malicious redirect response. Because the attack relies on user click‑through, the impact is primarily a social‑engineering risk rather than a direct compromise of the server itself.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade Echo to version 4.15.2 or later, or 5.1.1 or later, ensuring the redirect middleware is patched.
  • Modify the application configuration to explicitly whitelist allowed URI schemes when constructing redirects, preventing acceptance of arbitrary schemes.
  • If forwarded scheme headers are not required, disable proxy header trust or remove the ability to set X-Forwarded-Proto, X-Forwarded-Protocol, and X-Url-Scheme in the request pipeline.

Generated by OpenCVE AI on October 28, 2026 at 21:37 UTC.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Github GHSA Github GHSA GHSA-23wf-92cp-8pcj Echo has Arbitrary Scheme Injection in WWWRedirect/NonWWWRedirect Middlewares via X-Forwarded-Proto
History
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'poc', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
First Time appeared Labstack
Labstack echo
Vendors & Products Labstack
Labstack echo
Type Values Removed Values Added
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.
Title Echo: Arbitrary Scheme Injection in WWWRedirect/NonWWWRedirect Middlewares via X-Forwarded-Proto
Weaknesses CWE-601
References
Metrics cvssV3_1

{'score': 4.7, 'vector': 'CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:N'}

Weaknesses
  • CWE-601

    URL Redirection to Untrusted Site ('Open Redirect')

Sources

Status
PUBLISHED
Assigner
GitHub_M
Published
Updated
Nov 2, 2026, 8:44 PM
Reserved
Oct 28, 2026, 5:25 PM
Status
Undergoing Analysis
Published
Oct 28, 2026, 9:16 PM
Modified
Nov 2, 2026, 9:17 PM
Severity
Moderate
Public date
Oct 28, 2026, 8:17 PM