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

Published Oct 28, 2026
·
Updated

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.

Affected Software

1 affected component
Labstack Echo<4.15.2, <5.1.1

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade Echo to a version that resolves this vulnerability.

    Fixed in 4.15.2
  2. Upgrade

    Upgrade Echo to a version that resolves this vulnerability.

    Fixed in 5.1.1

Event History

Oct 28, 2026
CVE Published
via MITRE·08:17 PM
Data Sourced
via MITRE·08:17 PM
DescriptionSeverityWeakness

Frequently Asked Questions

1

Which deployments are exposed to this issue?

Deployments using Echo versions before 4.15.2 or 5.1.1 are exposed only if they enable the WWWRedirect or NonWWWRedirect middleware. HTTPS-specific redirect middleware variants are not affected.

2

What does an attacker need to exploit it?

An attacker must be able to supply a forwarded scheme header, such as X-Forwarded-Proto, X-Forwarded-Protocol, or X-Url-Scheme, to an affected redirect middleware. Exploitation also requires a user to interact with the resulting redirect response.

3

How can I determine whether my application is affected?

Check the Echo version and whether WWWRedirect or NonWWWRedirect middleware is configured. If either middleware is in use, test whether a request carrying one of the forwarded scheme headers can influence the URI scheme in the Location response header.

4

What should be done if upgrading is not immediately possible?

Prevent untrusted clients from controlling X-Forwarded-Proto, X-Forwarded-Protocol, and X-Url-Scheme before requests reach Echo. Upgrade to Echo 4.15.2 or 5.1.1 when possible.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203