{"id":"GHSA-h53f-rm2w-w7rg","aliases":["CVE-2026-118265"],"title":"Echo: X-Real-IP extractor trusts the header value instead of the sending peer","titleSource":"OSV","descriptionSource":"OSV","declaredSeverity":"MODERATE","description":"## 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.","severity":"medium","score":5.3,"published":"2026-10-23T20:50:25.000Z","modified":"2026-10-29T20:54:10.718Z","withdrawn":false,"knownExploited":false,"affected":[{"ecosystem":"Go","name":"github.com/labstack/echo/v5","sources":[{"name":"OSV · GHSA-h53f-rm2w-w7rg","url":"https://osv.dev/vulnerability/GHSA-h53f-rm2w-w7rg"}],"ranges":[{"events":[{"introduced":"5.0.0"},{"fixed":"5.4.1"}],"type":"SEMVER"}],"versions":[],"fixed":["5.4.1"]}],"sourceAffected":[],"references":["https://github.com/labstack/echo/security/advisories/GHSA-h53f-rm2w-w7rg","https://github.com/labstack/echo/commit/1855061e572ae9dab727c811d8382f266bfbaaec","https://github.com/labstack/echo","https://github.com/labstack/echo/releases/tag/v5.4.1","https://github.com/labstack/echo/commit/1855061e572ae9dab727c811d8382f266bfbaae"],"sources":[{"name":"OSV","id":"GHSA-h53f-rm2w-w7rg","modified":"2026-10-28T19:15:03.307613547Z","url":"https://osv.dev/vulnerability/GHSA-h53f-rm2w-w7rg"},{"name":"CVE","id":"CVE-2026-118265","modified":"2026-10-29T20:54:10.718Z","url":"https://www.cve.org/CVERecord?id=CVE-2026-118265"}],"assessments":[{"source":"OSV","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N","score":5.3},{"source":"GitHub_M","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N","score":5.3}],"cve":{"records":[{"id":"CVE-2026-118265","source":"GitHub_M","state":"PUBLISHED","reasons":[],"replacements":[],"disputed":false,"unsupportedWhenAssigned":false,"reserved":"2026-10-27T20:13:55.314Z","published":"2026-10-28T19:03:56.934Z","modified":"2026-10-29T20:54:10.718Z"}],"publishers":[{"name":"GitHub_M","role":"CNA","organizationId":"a0819718-46f1-4df5-94e2-005712e83aaa","modified":"2026-10-28T19:03:56.934Z"},{"name":"CISA-ADP","role":"ADP","organizationId":"134c704f-9b21-4f2e-91b3-4a467353bcc0","modified":"2026-10-29T20:54:10.718Z"}],"references":[{"url":"https://github.com/labstack/echo/security/advisories/GHSA-h53f-rm2w-w7rg","tags":["x_refsource_CONFIRM"],"source":"GitHub_M"},{"url":"https://github.com/labstack/echo/commit/1855061e572ae9dab727c811d8382f266bfbaae","tags":["x_refsource_MISC"],"source":"GitHub_M"},{"url":"https://github.com/labstack/echo/releases/tag/v5.4.1","tags":["x_refsource_MISC"],"source":"GitHub_M"}],"weaknesses":[{"id":"CWE-348","description":"CWE-348: Use of Less Trusted Source","source":"GitHub_M"}],"applicability":[],"prioritization":[{"source":"CISA-ADP","type":"SSVC","role":"CISA Coordinator","timestamp":"2026-10-29T15:43:31.934498Z","decisions":[{"name":"Exploitation","value":"none"},{"name":"Automatable","value":"yes"},{"name":"Technical Impact","value":"partial"}]}]},"products":[{"vendor":"labstack","name":"echo","platforms":[],"versions":[{"version":">= 5.0.0, < 5.4.1","status":"affected"}],"cpes":[],"source":"GitHub_M","url":"https://www.cve.org/CVERecord?id=CVE-2026-118265"}],"remediation":[],"observedAt":"2026-10-29T21:32:36.217Z","kev":{"status":"not-listed","checkedAt":"2026-10-31T03:05:31.332Z"},"coverage":[{"source":"NVD","status":"available","checkedAt":"2026-10-28T20:10:32.461Z","attemptedAt":"2026-10-28T20:10:32.461Z"},{"source":"GHSA","status":"available","checkedAt":"2026-10-28T20:10:32.461Z","attemptedAt":"2026-10-28T20:10:32.461Z"},{"source":"EUVD","status":"available","checkedAt":"2026-10-28T20:10:32.461Z","attemptedAt":"2026-10-28T20:10:32.461Z"},{"source":"EPSS","status":"no-result","checkedAt":"2026-10-28T20:10:32.461Z","attemptedAt":"2026-10-28T20:10:32.461Z"}],"evidence":[{"source":"GitHub Advisory Database","id":"GHSA-h53f-rm2w-w7rg","url":"https://github.com/advisories/GHSA-h53f-rm2w-w7rg","modified":"2026-10-28T19:04:05Z","score":5.3,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N","checkedAt":"2026-10-28T20:10:32.461Z"},{"source":"NVD","id":"CVE-2026-118265","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-118265","modified":"2026-10-28T19:17:31.377","score":5.3,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N","checkedAt":"2026-10-28T20:10:32.461Z"},{"source":"ENISA EUVD","id":"EUVD-2026-112397","url":"https://euvd.enisa.europa.eu/vulnerability/EUVD-2026-112397","modified":"Oct 28, 2026, 7:03:56 PM","score":5.3,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N","checkedAt":"2026-10-28T20:10:32.461Z"}],"aiSummary":null}