CVE-2026-72816
Description
go-chi/chi through 5.2.1 contains an IP spoofing vulnerability in the RealIP middleware (middleware/realip.go). The realIP() function reads client-controlled headers (True-Client-IP, X-Real-IP, and X-Forwarded-For) and overwrites r.RemoteAddr without verifying that the request originated from a trusted proxy. Attackers can supply arbitrary IP addresses in these headers to bypass IP-based access controls, evade rate limiting and geo-IP restrictions, and pollute audit logs. Fixed in 5.3.0.
How to fix
- github.com/go-chi/chi/v5/middleware5.3.0 or later
- github.com/go-chi/chi/v55.3.0 or later
Affected products
| Product | Affected versions | Fixed in |
|---|---|---|
| github.com/go-chi/chi/middlewareGo | v ≤ 1.5.5 | — |
| github.com/go-chi/chi/v2/middlewareGo | v ≤ 2.1.1 | — |
| github.com/go-chi/chi/v3/middlewareGo | v ≤ 3.3.5 | — |
| github.com/go-chi/chi/v4/middlewareGo | v ≤ 4.1.3 | — |
| github.com/go-chi/chi/v5/middlewareGo | v < 5.3.0 | 5.3.0 |
| github.com/go-chi/chi/v5Go | v < 5.3.0 | 5.3.0 |
Check your version
Choose the product and enter the version you run to see whether it falls in the affected range.
Attack Surface Management
See the assets tied to your domains, the technologies they run and known vulnerabilities in one list.