Skip to content

← Actionable
Medium, CVSS 5.3amended

Echo: Reverse Proxy Forwards Attacker-Supplied X-Real-IP to Upstream by Default

CVE-2026-118651GHSA-99jh-6h7p-pp36

What to do

Partial vendor fix. Follow the primary source's mitigation guidance and check back for a fix.

This page has no inventory attached, so it cannot say whether you are affected. A vendor fix is not proof that your deployment is fixed.

Affected packages

  • Go github.com/labstack/echo/v4

    Affected
    >= 4.0.0, <= 4.16.2
    Fixed in
    no fixed version recorded
  • Go github.com/labstack/echo/v5

    Affected
    < 5.4.0
    Fixed in
    5.4.0

Sources

Severity and exploitation
Exploitation
No confirmed exploitation recorded. Patch Next marks exploitation only from CISA KEV.
CVSS
5.3 · CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N
EPSS
  • CVE-2026-118651: 0.21% estimated exploitation activity in the next 30 days; percentile 10.83 (FIRST EPSS, 2026-11-03). This is a model estimate, not proof of exploitation or customer exposure.
Source description

As published by the source; long descriptions are shortened.

Summary The Echo proxy middleware (`middleware/proxy.go`) preserves an incoming `X-Real-IP` header verbatim and forwards it to the upstream service when `Echo#IPExtractor` is not configured — which is the default. Because any HTTP client can supply an arbitrary `X-Real-IP` value, an attacker can cause Echo to relay a spoofed client IP address to every upstream service behind the proxy, undermining upstream IP-based access controls, rate limiting, audit logging, and geo-restriction.

Affected Component - `middleware/proxy.go` — `ProxyConfig.ToMiddleware()`, header-rewriting block (lines 351–355)

Description

The header-preservation condition passes spoofed values to upstream `ProxyConfig.ToMiddleware()` (`proxy.go:338-405`) prepares forwarding headers before dispatching each request. The `X-Real-IP` rewrite logic at lines 351-355 reads: ```go // proxy.go:351-355 // Basically it's not good practice to unconditionally pass incoming x-real-ip header to upstream. // However,…

Dates and revisions
Published by the source
Last modified by the source
Source last checked
  1. Revision 2 · amended ·

    Amended from osv record GHSA-99jh-6h7p-pp36

  2. Revision 1 · created ·

    Published from ghsa record GHSA-99jh-6h7p-pp36

Agent brief

Preview the exact text before you copy it. Commands are read-only suggestions; review them before running anything.

# Patch Next advisory brief: CVE-2026-118651

Advisory: Echo: Reverse Proxy Forwards Attacker-Supplied X-Real-IP to Upstream by Default
IDs: CVE-2026-118651, GHSA-99jh-6h7p-pp36
Record: https://patchnext.com/advisories/cve-2026-118651 (revision 2, source checked 29 Oct 2026, 06:45 UTC)
Inventory: none attached. This brief comes from a public page and does not say whether any deployment is affected.
Severity: Medium (CVSS 5.3)
Exploitation: no confirmed exploitation recorded. Patch Next confirms exploitation only from CISA KEV.
Vendor response: Partial vendor fix; fixed versions by package: github.com/labstack/echo/v5 5.4.0. A vendor fix does not mean a deployment is fixed.

## Affected components
- Go github.com/labstack/echo/v4: affected >= 4.0.0, <= 4.16.2
- Go github.com/labstack/echo/v5: affected < 5.4.0; fixed in 5.4.0

## Suggested inspection (read-only)
- Go github.com/labstack/echo/v4: check the installed version with your package manager.
- Go github.com/labstack/echo/v5: check the installed version with your package manager.

## Supported action
No complete vendor fix is recorded. Follow the primary source's mitigation guidance and check this record again before closing anything.

## Required regression checks
- Run the test suite and a production build.
- Exercise the features that depend on github.com/labstack/echo/v4, github.com/labstack/echo/v5.
- Repeat the inspection and confirm that only fixed versions remain installed.

## Rollback considerations
- Keep the previous lockfile and deployment artifact. Rolling back reinstates the vulnerable version, so apply any documented mitigation while you fix forward.

## Unresolved questions
- Which deployments run an affected version?
- Exploitation status can change. Check again before lowering the priority.
- Mark the work resolved only after the fixed version is verified in production.

## Sources
- Verified: https://github.com/advisories/GHSA-99jh-6h7p-pp36 (GitHub-reviewed advisory GHSA-99jh-6h7p-pp36 lists affected ranges: Go github.com/labstack/echo/v5 >=0 =4.0.0 <=4.16.2)
- Verified: https://osv.dev/vulnerability/GHSA-99jh-6h7p-pp36 (OSV record GHSA-99jh-6h7p-pp36 lists affected ranges: Go github.com/labstack/echo/v5 >=0 =4.0.0 <=4.16.2)

Commands are suggestions: review each one before running it.

Loading voting…