Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessReach Go server directly bypassing proxy
-
ExploitCraft X-Forwarded-For with trusted proxy address
-
ExecutionMiddleware GetClientIP returns spoofed IP
-
ImpactBypass IP allowlist / rate limit / forge logs
Vulnerability Assessment
| Weakness |
CWE
ASVS 5.0
V6 - Authentication IP-independent access control
|
| Exploitation Conditions | Exploitation requires the target application to use chi's ClientIPFromXFF middleware configured with at least one trusted CIDR, AND to consume the resulting value via middleware.GetClientIP for a security-relevant purpose (IP allowlisting, rate limiting, geolocation, or audit logging). The attacker must be able to connect to the Go server directly rather than exclusively through the legitimate reverse proxy, because the bug is that RemoteAddr (the direct TCP peer) is never checked against the trusted CIDR. Limiting factors: the vulnerable middleware is opt-in and not part of chi's default routing; the attacker benefits from knowing the configured trusted CIDR to append a convincing proxy address; and if a fronting proxy strips or overwrites X-Forwarded-For and no direct network path to the Go server exists, exploitation is blocked. Deployments that do not derive trust from the client IP are unaffected in practice. |
| Impact | This is a moderate-severity logic flaw (CWE-348, Use of Less Trusted Source / IP spoofing) in the go-chi ClientIPFromXFF middleware, scored CVSS 4.0 6.3 by the reporter. The 4.0 vector (AV:N/AC:H/PR:N/UI:N) shows an unauthenticated, remotely reachable issue but with high attack complexity and only Low confidentiality and integrity impact (VC:L/VI:L) and no availability impact - consistent with trust/spoofing bugs rather than code execution. No EPSS score, CISA KEV listing, or public POC was provided in the input, so by the precision rule the status is 'no public exploit identified at time of analysis.' The real-world priority is conditional rather than universal: the flaw only matters for applications that both enable this specific middleware with a trusted-CIDR configuration AND make security decisions (access control, rate limiting, audit logging) based on the returned client IP. Where that pattern exists the bug is genuinely exploitable and meaningful; where it does not, impact is negligible. The AC:H rating is reasonable because the attacker must reach the Go server directly (bypassing legitimate proxies) and understand the configured trusted CIDRs. No signals conflict; the chief limiting factor is the non-default, configuration-dependent nature of the vulnerable code path. |
| Exploit ScenarioDerived | An application uses chi's ClientIPFromXFF middleware with a trusted proxy CIDR and enforces IP-based access control or rate limiting via GetClientIP. An attacker who can reach the Go server directly (not through the real proxy) sends a request with a crafted X-Forwarded-For header appending a trusted-looking proxy address, causing the middleware to return an attacker-chosen client IP and thereby spoof their source to bypass IP allowlists, evade rate limits, or forge audit log entries. No public exploit code was identified in the provided data, though the technique is trivial to reproduce once the trusted CIDR is known. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Oct 21, 2026
IP spoofing in Go Chi before 5.4.0 allows an unauthenticated client that can reach the Go server directly to forge its apparent source address through the opt-in ClientIPFromXFF middleware. The middleware skips X-Forwarded-For entries that fall inside a configured trusted CIDR but never verifies that the direct TCP peer in http.Request.RemoteAddr belongs to that same CIDR, so an attacker can append a trusted-looking proxy address and control the value returned by middleware.GetClientIP. This is a moderate-severity logic flaw (CWE-348) that matters only where applications use the derived client IP for allowlisting, rate limiting, geolocation, or audit logging; no public exploit identified at time of analysis.
RemediationAI
Upgrade go-chi/chi to 5.4.0 or later, which is the first release not listed as affected; the fix should cause the middleware to validate the direct TCP peer in http.Request.RemoteAddr against the trusted CIDR set before honoring X-Forwarded-For entries. If immediate upgrade is not possible, restrict network access so the Go server can only be reached through the legitimate reverse proxy and cannot be contacted directly, accepting that this may require firewall or security-group changes and could break direct-access workflows; alternatively, configure the fronting proxy to strip or overwrite any client-supplied X-Forwarded-For header before forwarding, with the trade-off that misconfigured proxies may still pass attacker-controlled values. Applications that cannot enforce either control should avoid using ClientIPFromXFF/GetClientIP for allowlisting, rate limiting, geolocation, or audit logging until patched, or add custom code that independently rejects requests whose RemoteAddr is outside the trusted proxy ranges. Vendor advisory: https://github.com/go-chi/chi/security/advisories/GHSA-j6qf-3m9c-vwj3.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 2 packages in go, euvd
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
The issue is a CWE-348 (Use of Less Trusted Source) logic error in the go-chi/chi Go web framework's ClientIPFromXFF middleware. X-Forwarded-For is an HTTP header that any client can supply, and the middleware is designed to derive the real client IP by walking that header and skipping entries that belong to configured trusted proxy CIDRs. The defect is that the trust decision is applied only to XFF entries; the direct TCP peer address in http.Request.RemoteAddr, which Go's net/http server populates from the actual connection, is never checked against the trusted CIDR set. Consequently, a client with a direct network path to the Go server can prepend or append an address inside the trusted range and have it accepted as the originating proxy hop, causing middleware.GetClientIP to return an attacker-chosen value. The vulnerable code is opt-in and not part of chi's default routing, so the underlying technology exposure depends on application configuration: the CPE cpe:2.3:a:go-chi:chi:*:*:*:*:*:*:*:* covers all chi releases before 5.4.0 across platforms. Exploitation is conditional on the target using ClientIPFromXFF with at least one trusted CIDR and consuming GetClientIP for a security-relevant decision, and is blocked when a fronting proxy strips or overwrites X-Forwarded-For and no direct path to the Go server exists.
Know when Chi gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
CVSS:4.0/AV:N/AC:H/AT:N/PR:N/UI:N/VC:L/VI:L/VA:N/SC:N/SI:N/SA:N
Remote and unauthenticated (AV:N/PR:N) but AC:H because it needs the opt-in trusted-CIDR middleware and direct server reach; spoofed IP yields Low C and I, no availability impact.
Primary rating from Vendor (tenable).
CVSS VectorVendor: tenable
Lifecycle Timeline
2DescriptionCVE.org
In the Golang Chi web framework, the ClientIPFromXFF middleware skips any X-Forwarded-For entry in a configured trusted CIDR but never verifies that the direct TCP peer in http.Request.RemoteAddr belongs to that CIDR. A client that can reach the Go server directly can therefore append a trusted-looking proxy address and choose the client IP returned by middleware.GetClientIP.
This issue affects chi before 5.4.0.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Information disclosure occurs when an application unintentionally exposes sensitive data that aids attackers in reconnaissance or directly compromises security.
IP spoofing via the RealIP middleware in go-chi/chi (versions 5.2.1 through 5.2.x) allows unauthenticated remote attacke
IP spoofing in go-chi/chi's RealIP middleware through version 5.2.1 enables unauthenticated remote attackers to inject a
IP spoofing in go-chi's RealIP middleware allows unauthenticated network attackers to forge the apparent client source I
Open redirect in chi (go-chi/chi) versions before 5.2.2 allows Host header injection via the RedirectSlashes middleware,
EUVD-2026-107261
GHSA-7cgw-qmxx-7fc2
NVD
CVE.org
EPSS
Vulnrichment
Exploit-DB