# CVE-2026-118656: Echo open redirect in sanitizeURI with trailing slash redirect

Source: https://junglewise.ai/threats/cve-2026-118656-echo-is-a-go-web-framework-prior-to-4-16-0-and-5-4-0-sanitizeuri  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-10-28. Updated: 2026-10-28  
License: CC BY 4.0 with a link back

CVE-2026-118656 · Severity: medium · CVSS 6.1 · Published 2026-10-28

Echo is a popular Go web framework used to build REST APIs and web applications. When configured to automatically add or remove trailing slashes with a redirect response, a flaw in the URI sanitization logic allows attackers to craft URLs that bypass the redirect guard and redirect users to arbitrary websites, potentially leading to phishing attacks or credential theft.

Technologies: [github.com/labstack/echo/v4 (Go)](https://junglewise.ai/threats/technologies/github-com-labstack-echo-v4), [github.com/labstack/echo/v5 (Go)](https://junglewise.ai/threats/technologies/github-com-labstack-echo-v5), [Labstack Echo](https://junglewise.ai/threats/technologies/labstack-echo). Vendors: [Go](https://junglewise.ai/threats/vendors/go), [Labstack](https://junglewise.ai/threats/vendors/labstack).

## Quick answers

**Is CVE-2026-118656 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2026-118656 being exploited in the wild.

**How severe is CVE-2026-118656?** Medium severity, with a CVSS score of 6.1, published 28 October 2026.

**Which products and versions are affected?** github.com/labstack/echo/v4 (Go) < 4.16.0, SEMVER:introduced=0,fixed=4.16.0; github.com/labstack/echo/v5 (Go) < 5.4.0, SEMVER:introduced=0,fixed=5.4.0; Labstack Echo before 4.16.0 and before 5.4.0.

**Is there a fix for CVE-2026-118656?** Yes. github.com/labstack/echo/v4 (Go): upgrade to 4.16.0 or later; github.com/labstack/echo/v5 (Go): upgrade to 5.4.0 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2026-118656 attacked?** It is attacked over the network, in a software library.

**Am I affected by CVE-2026-118656?** 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.16.0 or later

  ```sh
  go get github.com/labstack/echo/v4@v4.16.0
  ```

- github.com/labstack/echo/v5 (Go): upgrade to 5.4.0 or later

  ```sh
  go get github.com/labstack/echo/v5@v5.4.0
  ```


## Technical details

The sanitizeURI function checks only the first two bytes of a redirect target to detect absolute-path separators (//). An attacker can embed a tab character (0x09) or other control character before the double slash in a crafted path like /%09/evil.example/, which is normalized by browsers and bypasses the validation. This occurs in the AddTrailingSlash and RemoveTrailingSlash middleware when configured with a redirect response, allowing the attacker-controlled host to appear in the Location header.

## Affected products

- labstack Echo before 4.16.0 and before 5.4.0

## Identifiers

- CVE-2026-118656
- GHSA-v753-g4cw-jm48
- GO-2026-6883

## Timeline

- 2026-10-28: disclosed: CVE-2026-118656 published
- 2026-09-27: patched: Fix merged in v4.16.0 and v5.4.0

## References

- [https://github.com/labstack/echo/commit/b838391e2eade87ae7e5a09d7bb5087bec271ec1](https://github.com/labstack/echo/commit/b838391e2eade87ae7e5a09d7bb5087bec271ec1)
- [https://github.com/labstack/echo/commit/fc410094b2f3415cf2bf5204082137b205bfd5af](https://github.com/labstack/echo/commit/fc410094b2f3415cf2bf5204082137b205bfd5af)

## Related threats

- [Echo web framework arbitrary URI scheme redirect](https://junglewise.ai/threats/cve-2026-118658-echo-is-a-go-web-framework-prior-to-4-15-2-and-5-1-1-context)
- [Echo Go web framework scheme header spoofing and HSTS bypass](https://junglewise.ai/threats/cve-2026-118657-echo-is-a-go-web-framework-prior-to-4-16-0-and-5-4-0-context)
- [Echo path traversal via double URL encoding in Static middleware](https://junglewise.ai/threats/cve-2026-118655-echo-is-a-go-web-framework-prior-to-4-15-3-and-5-2-0-middleware)
- [Echo path traversal in static file handlers via dot segment normalization](https://junglewise.ai/threats/cve-2026-118654-echo-is-a-go-web-framework-prior-to-4-16-0-and-5-4-0-echo-s)
- [Echo Go web framework rate-limit bypass via spoofed IP headers](https://junglewise.ai/threats/cve-2026-118653-echo-is-a-go-web-framework-from-4-0-0-until-5-1-0-context-realip)
