5.3medium
Echo: X-Real-IP extractor trusts the header value instead of the sending peer
- Severity
- 5.3medium CVSS:3.1 by GitHub_M
- Exploit likelihood
- 0.17% (higher than 6% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-h53f-rm2w-w7rgGO-2026-6841
Description
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
| Product or package | Versions | Reported by |
|---|---|---|
| labstack echo | >= 5.0.0, < 5.4.1 | CVE List |
| github.com/labstack/echo/v5 (Go) | from 5.0.0 before 5.4.1 | GitHub Advisory Database, Go Vulnerability Database |
All scores
| GitHub_M | 5.3medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N |
| GitHub | 5.3medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N |
Classification
SSVC (CISA-ADP): exploitation none, automatable yes, technical impact partial.
What each source says
CVE List
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.
GitHub Advisory Database
Impact
In Echo v5, ExtractIPFromRealIPHeader checked whether the address supplied in X-Real-IP belonged to a trusted range instead of checking the address of the direct network peer. An untrusted client could therefore supply a loopback or private address and have it returned by c.RealIP() with the extractor's default trust options.
Applications using this extractor for IP allowlists, IP-based rate limiting, audit logs or forwarding headers could accept a spoofed client identity. Exploitation requires that the attacker can reach Echo directly or that an intervening proxy passes through the attacker's X-Real-IP value. Applications using the default direct IP extractor are unaffected. Echo v4 is unaffected by this v5 regression.
Affected versions and patch
All v5 releases from v5.0.0 through v5.4.0 are affected. Upgrade to v5.4.1.
The patch validates the direct peer before accepting a syntactically valid X-Real-IP value, restoring the v4 trust model. Fix commit.
Workarounds
Use ExtractIPDirect until upgrading, or ensure that only trusted proxies can reach Echo and that they replace client-supplied forwarding headers. Configure trusted proxy ranges narrowly for the deployment.
Credits
Reported and patched by @rm-Umar. @Duodum independently reported the same issue in GHSA-c3r7-8j36-7mx8, which is tracked as a duplicate of this advisory.
Go Vulnerability Database
Echo: X-Real-IP extractor trusts the header value instead of the sending peer in github.com/labstack/echo
NVD (es)
Echo es un framework web de Go. Desde la versión 5.0.0 hasta la 5.4.1 incluida, la función ExtractIPFromRealIPHeader de Echo v5 valida si el valor X-Real-IP suministrado por el cliente pertenece a un rango de confianza en lugar de validar el par de red directo. Un cliente que accede a Echo directamente, o a través de un proxy que conserva la cabecera, puede proporcionar una dirección de bucle invertido o privada y hacer que Context.RealIP devuelva esa identidad suplantada. Las aplicaciones que utilizan el extractor para listas blancas de IP, limitación de velocidad, registros de auditoría o cabeceras de reenvío pueden, en consecuencia, confiar en una dirección controlada por el atacante; el extractor directo predeterminado y Echo v4 no se ven afectados. Este problema está solucionado en la versión 5.4.1.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-118265 changed 2026-10-29 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-h53f-rm2w-w7rg changed 2026-11-05 | CC-BY-4.0 |
| Go Vulnerability Database | GO-2026-6841 changed 2026-11-05 | CC-BY-4.0 |
| NVD | CVE-2026-118265 changed 2026-11-04 | Public domain |