medium5.3
CVE-2026-118265
Echo: X-Real-IP extractor trusts the header value instead of the sending peer
Impact
Echo is a Go web framework. From 5.0.0 until 5.4.1, Echo v5's ExtractIPFromRealIPHeader validates whether the client-supplied X-Real-IP value belongs to a trusted range instead of validating the direct network peer. A client reaching Echo directly, or through a proxy that preserves the header, can supply a loopback or private address and have Context.RealIP return that spoofed identity. Applications using the extractor for IP allowlists, rate limiting, audit logs, or forwarding headers can consequently trust an attacker-controlled address; the default direct extractor and Echo v4 are unaffected. This issue is fixed in 5.4.1.
Affected packages
| Ecosystem | Package | Affected | Fixed in |
|---|---|---|---|
| go | github.com/labstack/echo/v5 | >= 5.0.0, < 5.4.1 | 5.4.1 |
Weakness classification
References
- NVD record
- CVE.org record
- GitHub advisory
- https://github.com/advisories/GHSA-h53f-rm2w-w7rg
- https://github.com/labstack/echo/security/advisories/GHSA-h53f-rm2w-w7rg
- https://github.com/labstack/echo/commit/1855061e572ae9dab727c811d8382f266bfbaaec
- https://github.com/labstack/echo/releases/tag/v5.4.1
- https://github.com/labstack/echo/commit/1855061e572ae9dab727c811d8382f266bfbaae