go-chi chi v5.2.1 IP Spoofing via X-Forwarded-For Header
go-chi chi
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| github.com/go-chi/chi/v5/middleware Go |
|
|
| github.com/go-chi/chi/v5 Go |
|
|
go-chi chi
| Product | Affected | Fixed in |
|---|---|---|
| github.com/go-chi/chi/v5/middleware Go |
|
|
| github.com/go-chi/chi/v5 Go |
|
|
go-chi chi versions >= 5.2.1 and before 5.3.0 contain an IP spoofing vulnerability in the RealIP middleware, which blindly trusts the first (leftmost) value of the X-Forwarded-For HTTP header. A remote attacker can bypass IP-based access control lists and rate-limiting mechanisms, and forge log entries, by supplying a spoofed IP address in the X-Forwarded-For header. The issue is fixed in version 5.3.0.
From the CVE record · VulnCheck
The RealIP middleware in go-chi chi blindly trusts the leftmost IP address in the X-Forwarded-For header. A remote attacker can supply a spoofed address to bypass IP-based access controls and rate limits, or forge log entries. The description does not specify an authentication or user-interaction requirement.
Engineers running Go packages github.com/go-chi/chi/v5 or github.com/go-chi/chi/v5/middleware at versions >=5.2.1 and <5.3.0 should check their deployments.