# Chi web framework client IP spoofing via X-Forwarded-For

Source: https://junglewise.ai/threats/duplicate-advisory-chi-client-ip-spoofing-in-clientipfromxff-via-x-f73190e1  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-10-21. Updated: 2026-10-23  
License: CC BY 4.0 with a link back

Severity: medium · CVSS 4.8 · Published 2026-10-21

Chi is a routing middleware for Go web applications that can extract client IP addresses from X-Forwarded-For headers when behind a proxy. A vulnerability in the ClientIPFromXFF middleware allows attackers to spoof their client IP by directly accessing the server and adding fake X-Forwarded-For headers, potentially bypassing IP-based access controls or security policies that depend on accurate client identification.

Technologies: [github.com/go-chi/chi/v5 (Go)](https://junglewise.ai/threats/technologies/github-com-go-chi-chi-v5), [Go-Chi Chi](https://junglewise.ai/threats/technologies/chi). Vendors: [Go](https://junglewise.ai/threats/vendors/go), [Go-Chi](https://junglewise.ai/threats/vendors/go-chi).

## Quick answers

**Is This vulnerability exploited in the wild?** No. Junglewise Threat Intelligence has no report of This vulnerability being exploited in the wild.

**How severe is This vulnerability?** Medium severity, with a CVSS score of 4.8, published 21 October 2026.

**Which products and versions are affected?** github.com/go-chi/chi/v5 (Go) <= 5.3.2, SEMVER:introduced=0,last_affected=5.3.2; Go-Chi Chi before 5.4.0.

**Is there a fix for This vulnerability?** Yes: fixed in 5.4.0. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is This vulnerability attacked?** It is attacked over the network, in a software library.

**Am I affected?** Check whether you run github.com/go-chi/chi/v5 (Go) or Go-Chi Chi at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- Fixed in 5.4.0

## Technical details

The ClientIPFromXFF middleware validates X-Forwarded-For entries against a configured trusted CIDR range but fails to verify that the direct TCP peer (http.Request.RemoteAddr) actually belongs to that trusted range. An attacker with direct network access can craft requests with forged X-Forwarded-For headers listing trusted proxy IPs, allowing arbitrary client IP spoofing. The vulnerability affects versions before 5.4.0 and requires network access to the origin server but no authentication or user interaction.

## Affected products

- go-chi chi before 5.4.0

## Timeline

- 2026-10-12: disclosed
- 2026-10-21: advisory

## References

- [https://github.com/go-chi/chi/security/advisories/GHSA-j6qf-3m9c-vwj3](https://github.com/go-chi/chi/security/advisories/GHSA-j6qf-3m9c-vwj3)

## Related threats

- [go-chi chi open redirect in RedirectSlashes middleware](https://junglewise.ai/threats/cve-2026-122132-go-chi-chi-5-2-2-through-5-5-0-contains-an-open-redirect)
- [Go Chi ClientIPFromXFF IP spoofing via X-Forwarded-For](https://junglewise.ai/threats/cve-2026-114437-in-the-golang-chi-web-framework-the-clientipfromxff-middleware)
- [GO-2026-5775 - Chi Middleware vulnerable to IP spoofing via X-Forwarded-For header in github.com/go-chi/chi](https://junglewise.ai/threats/cve-2026-72817-chi-middleware-vulnerable-to-potential-ip-spoofing-via-x)
- [GO-2026-5777 - Chi's RealIP Middleware allows IP spoofing via unvalidated X-Forwarded-For header in github.com/go-chi/chi](https://junglewise.ai/threats/cve-2026-72816-chi-s-realip-middleware-allows-ip-spoofing-via-unvalidated-x)
- [GO-2026-5774 - Chi has an IP spoofing vulnerability in middleware.RealIP in github.com/go-chi/chi](https://junglewise.ai/threats/cve-2026-72815-chi-has-an-ip-spoofing-vulnerability-in-middleware-realip)
