CVE-2026-118658: Echo web framework arbitrary URI scheme redirect

CVE-2026-118658 · Severity: medium · CVSS 4.7 · Published 2026-10-28

Echo is a popular Go web framework used to build REST APIs and web applications. A flaw in how it processes redirect headers allows an attacker to craft a malicious redirect that points to any URI scheme (such as javascript: or data:), potentially leading to phishing or credential theft if a user clicks the redirect. The vulnerability requires an application to use Echo's redirect middleware and a user to click the attacker's crafted link.

Technologies: github.com/labstack/echo/v4 (Go), github.com/labstack/echo/v5 (Go), Labstack Echo. Vendors: Go, Labstack.

Quick answers

Is CVE-2026-118658 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2026-118658 being exploited in the wild.
How severe is CVE-2026-118658?
Medium severity, with a CVSS score of 4.7, published 28 October 2026.
Which products and versions are affected?
github.com/labstack/echo/v4 (Go) < 4.15.2, SEMVER:introduced=0,fixed=4.15.2; github.com/labstack/echo/v5 (Go) < 5.1.1, SEMVER:introduced=0,fixed=5.1.1; Labstack Echo before 4.15.2 and 5.0.x before 5.1.1.
Is there a fix for CVE-2026-118658?
Yes. github.com/labstack/echo/v4 (Go): upgrade to 4.15.2 or later; github.com/labstack/echo/v5 (Go): upgrade to 5.1.1 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is CVE-2026-118658 attacked?
It is attacked over the network.
Am I affected by CVE-2026-118658?
Check whether you run github.com/labstack/echo/v4 (Go), github.com/labstack/echo/v5 (Go) or Labstack Echo at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

How to fix

  • github.com/labstack/echo/v4 (Go): upgrade to 4.15.2 or later
    go get github.com/labstack/echo/v4@v4.15.2
  • github.com/labstack/echo/v5 (Go): upgrade to 5.1.1 or later
    go get github.com/labstack/echo/v5@v5.1.1

Technical details

Echo's Context.Scheme method accepts values from the X-Forwarded-Proto, X-Forwarded-Protocol, and X-Url-Scheme headers without validation, allowing arbitrary URI schemes. The WWWRedirect and NonWWWRedirect middleware use this value to construct Location headers, enabling an attacker to inject non-standard schemes. This affects only the generic redirect variants; the HTTPS-specific variants are unaffected as they hardcode the scheme.

Affected products

  • labstack Echo before 4.15.2 and 5.0.x before 5.1.1

Identifiers

  • CVE-2026-118658
  • GHSA-23wf-92cp-8pcj
  • GO-2026-6878

Timeline

  • 2026-10-28: disclosed

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.