{"id":"CVE-2026-118265","aliases":["CVE-2026-118265","GHSA-h53f-rm2w-w7rg","GO-2026-6841"],"related":[],"kind":"vulnerability","state":"published","title":"Echo: X-Real-IP extractor trusts the header value instead of the sending peer","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"en","text":"## Impact\n\nIn 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.\n\nApplications 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.\n\n## Affected versions and patch\n\nAll v5 releases from v5.0.0 through v5.4.0 are affected. Upgrade to [v5.4.1](https://github.com/labstack/echo/releases/tag/v5.4.1).\n\nThe patch validates the direct peer before accepting a syntactically valid `X-Real-IP` value, restoring the v4 trust model. [Fix commit](https://github.com/labstack/echo/commit/1855061e572ae9dab727c811d8382f266bfbaaec).\n\n## Workarounds\n\nUse `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.\n\n## Credits\n\nReported 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.","format":"markdown","source":"ghsa"},{"lang":"en","text":"Echo: X-Real-IP extractor trusts the header value instead of the sending peer in github.com/labstack/echo","format":"markdown","source":"go"},{"lang":"es","text":"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.","source":"nvd"}],"published":"2026-10-23T20:50:25.000Z","modified":"2026-11-05T23:25:48.522Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N","score":5.3,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N","score":5.3,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N","score":5.3,"rating":"MEDIUM"}],"cwes":["CWE-348"],"affected":[{"ranges":[{"version":">= 5.0.0, < 5.4.1","status":"affected"}],"vendor":"labstack","product":"echo","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"5.0.0","status":"affected","fixed":"5.4.1"}],"ecosystem":"Go","package":"github.com/labstack/echo/v5","purl":"pkg:golang/github.com/labstack/echo/v5","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"5.0.0","status":"affected","fixed":"5.4.1"}],"ecosystem":"Go","package":"github.com/labstack/echo/v5","purl":"pkg:golang/github.com/labstack/echo/v5","source":"go"}],"references":[{"url":"https://github.com/labstack/echo/security/advisories/GHSA-h53f-rm2w-w7rg","tags":["advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://github.com/labstack/echo/commit/1855061e572ae9dab727c811d8382f266bfbaae","tags":["x-refsource-misc"],"sources":["cvelist","nvd"]},{"url":"https://github.com/labstack/echo/releases/tag/v5.4.1","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://github.com/labstack/echo/commit/1855061e572ae9dab727c811d8382f266bfbaaec","tags":["fix","web"],"sources":["ghsa","go"]},{"url":"https://github.com/labstack/echo","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"yes","technicalImpact":"partial","date":"2026-10-29T15:43:31.934Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-118265","url":"https://www.cve.org/CVERecord?id=CVE-2026-118265","licence":"CVE Terms of Use","modified":"2026-10-29T20:54:10.718Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-h53f-rm2w-w7rg","url":"https://github.com/advisories/GHSA-h53f-rm2w-w7rg","licence":"CC-BY-4.0","modified":"2026-11-05T23:25:48.522Z"},{"source":"go","name":"Go Vulnerability Database","id":"GO-2026-6841","url":"https://pkg.go.dev/vuln/GO-2026-6841","licence":"CC-BY-4.0","modified":"2026-11-05T23:25:48.522Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-118265","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-118265","licence":"Public domain","modified":"2026-11-04T23:10:00.223Z"}],"updatedAt":"2026-11-25T22:59:47.671Z","epss":{"score":0.00169,"percentile":0.06587,"date":"2026-12-01T12:00:22.000Z"}}