/

CVE-2026-118650

Severity:

HIGH RISK

(7.5)

URL Decoding Mismatch (CWE-177) in Echo Web Framework

CVE-2026-118650

Undergoing Analysis

Vulnerability type

Category:

URL Path Confusion

CWE:

CWE-177, CWE-863

Impact:

Authorization Bypass and Unintended File Access

Severity:

HIGH RISK

(7.5)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

Echo's globally mounted static middleware may interpret encoded request paths differently from the router, which matches the still-encoded path. Under affected configurations, this mismatch could allow a request to resolve to an unintended file beneath the static root and may bypass expected route or group protections.

Echo's globally mounted static middleware may interpret encoded request paths differently from the router, which matches the still-encoded path. Under affected configurations, this mismatch could allow a request to resolve to an unintended file beneath the static root and may bypass expected route or group protections.

Affected context

The issue occurs in Echo applications using a globally mounted middleware.Static instance with affected framework versions. Risk is increased when URL paths containing encoded separators are routed using the encoded form but later resolved by the static handler after decoding, particularly where authorization depends on route or group matching. The precise protection behavior can vary with the application's routing configuration.

The issue occurs in Echo applications using a globally mounted middleware.Static instance with affected framework versions. Risk is increased when URL paths containing encoded separators are routed using the encoded form but later resolved by the static handler after decoding, particularly where authorization depends on route or group matching. The precise protection behavior can vary with the application's routing configuration.

Exploit preconditions

  • Attack surface: HTTP endpoints served by Echo's global static middleware
  • Required access: Network access to the affected web application; authentication requirements depend on application-level controls
  • Trigger point: Processing of a request path containing encoded URL characters, such as an encoded slash
  • Why exploitation is possible: The router and static handler can apply different representations of the same path, allowing the static handler to resolve a resource that was not selected by the router's encoded-path match
  • Attack surface: HTTP endpoints served by Echo's global static middleware
  • Required access: Network access to the affected web application; authentication requirements depend on application-level controls
  • Trigger point: Processing of a request path containing encoded URL characters, such as an encoded slash
  • Why exploitation is possible: The router and static handler can apply different representations of the same path, allowing the static handler to resolve a resource that was not selected by the router's encoded-path match

Why this happens

The underlying bug is inconsistent URL canonicalization between routing and static-file resolution. Echo's router evaluates the still-encoded request path, while the static middleware uses the decoded URL.Path; therefore, encoded separators may change path boundaries between authorization or route selection and resource lookup. This maps primarily to CWE-177: Improper Handling of URL Encoding, with CWE-863: Incorrect Authorization relevant when the mismatch allows route or group protections to be bypassed.

The underlying bug is inconsistent URL canonicalization between routing and static-file resolution. Echo's router evaluates the still-encoded request path, while the static middleware uses the decoded URL.Path; therefore, encoded separators may change path boundaries between authorization or route selection and resource lookup. This maps primarily to CWE-177: Improper Handling of URL Encoding, with CWE-863: Incorrect Authorization relevant when the mismatch allows route or group protections to be bypassed.

Potential impact

  • An attacker may access files that were not intended to be reachable through the matched route
  • Authorization or route-group checks could be bypassed in affected configurations
  • Sensitive static assets or configuration-related files could be exposed
  • Application security boundaries based on URL path matching could be weakened
  • An attacker may access files that were not intended to be reachable through the matched route
  • Authorization or route-group checks could be bypassed in affected configurations
  • Sensitive static assets or configuration-related files could be exposed
  • Application security boundaries based on URL path matching could be weakened

General mitigation guidance

Mitigation generally focuses on using a single, consistent URL canonicalization model across routing, authorization, and resource resolution.

Defensive patterns include:

  • Normalize and validate paths before route matching and file resolution
  • Reject ambiguous or encoded path separators when they are not required
  • Apply authorization checks to the canonical resource identity rather than only the raw route
  • Prefer narrowly scoped static handlers instead of broad global mounts where feasible
  • Restrict static roots to non-sensitive, least-privilege directories
  • Use framework configurations and routing designs that preserve consistent encoded and decoded path semantics

Mitigation generally focuses on using a single, consistent URL canonicalization model across routing, authorization, and resource resolution.

Defensive patterns include:

  • Normalize and validate paths before route matching and file resolution
  • Reject ambiguous or encoded path separators when they are not required
  • Apply authorization checks to the canonical resource identity rather than only the raw route
  • Prefer narrowly scoped static handlers instead of broad global mounts where feasible
  • Restrict static roots to non-sensitive, least-privilege directories
  • Use framework configurations and routing designs that preserve consistent encoded and decoded path semantics

How teams detect issues like this

Detection can include:

  • Static analysis and dependency review for globally mounted static middleware
  • Code review checks for differences between router matching, URL decoding, and filesystem lookup
  • Tests covering encoded separators, alternate path representations, and authorization boundaries
  • Web application firewall or gateway policies that reject ambiguous encoded path delimiters where appropriate
  • Monitoring for unusual requests containing encoded slashes or repeated path canonicalization patterns

Automated security review tools may help identify risky static-file mounts and inconsistent path handling.

Detection can include:

  • Static analysis and dependency review for globally mounted static middleware
  • Code review checks for differences between router matching, URL decoding, and filesystem lookup
  • Tests covering encoded separators, alternate path representations, and authorization boundaries
  • Web application firewall or gateway policies that reject ambiguous encoded path delimiters where appropriate
  • Monitoring for unusual requests containing encoded slashes or repeated path canonicalization patterns

Automated security review tools may help identify risky static-file mounts and inconsistent path handling.

Sources

SourceLink
github.comgithub.com/labstack/echo/commit/b838391e2eade87ae7e5a09d7bb5087bec271ec1
github.comgithub.com/labstack/echo/commit/fc410094b2f3415cf2bf5204082137b205bfd5af
github.comgithub.com/labstack/echo/releases/tag/v4.16.0
github.comgithub.com/labstack/echo/releases/tag/v5.4.0
github.comgithub.com/labstack/echo/security/advisories/GHSA-375p-5qhx-8wq4

Frequently asked

questions

It can be, because the trigger is an HTTP request. Exploitability depends on whether the application uses the affected global static middleware configuration and whether the requested resource is accessible through that path.

Not necessarily. Authentication requirements are determined by the application's route and middleware controls, but the path interpretation mismatch may weaken those controls in affected configurations.

Use framework versions containing the fix, and ensure that routing, authorization, and static-file resolution operate on the same canonical path representation. Avoid broad static mounts and reject ambiguous encoded separators when possible.

Test encoded and normalized path variants at authorization boundaries, review canonicalization order during code review, restrict static roots, and enforce consistent URL handling policies across application components.

It can be, because the trigger is an HTTP request. Exploitability depends on whether the application uses the affected global static middleware configuration and whether the requested resource is accessible through that path.

Not necessarily. Authentication requirements are determined by the application's route and middleware controls, but the path interpretation mismatch may weaken those controls in affected configurations.

Use framework versions containing the fix, and ensure that routing, authorization, and static-file resolution operate on the same canonical path representation. Avoid broad static mounts and reject ambiguous encoded separators when possible.

Test encoded and normalized path variants at authorization boundaries, review canonicalization order during code review, restrict static roots, and enforce consistent URL handling policies across application components.

Find out what's already
exploitable in your codebase.