CVE-2026-72816
go-chi chi before 5.3.0 IP Spoofing via RealIP Middleware
Also known as GHSA-rjr7-jggh-pgcp, GO-2026-5777
Mitigation
- Upgrade github.com/go-chi/chi/v5/middleware to 5.3.0 or later.
- Upgrade github.com/go-chi/chi/v5 to 5.3.0 or later.
Who should check
- Projects that depend on Go package github.com/go-chi/chi/middleware (<= 1.5.5)
- Projects that depend on Go package github.com/go-chi/chi/v2/middleware (<= 2.1.1)
- Projects that depend on Go package github.com/go-chi/chi/v3/middleware (<= 3.3.5)
- Projects that depend on Go package github.com/go-chi/chi/v4/middleware (<= 4.1.3)
- Projects that depend on Go package github.com/go-chi/chi/v5/middleware (< 5.3.0)
- Projects that depend on Go package github.com/go-chi/chi/v5 (< 5.3.0)
- Anyone running go-chi chi < 5.3.0
Vulnerability facts
- Affected
- github.com/go-chi/chi/middleware <= 1.5.5; github.com/go-chi/chi/v2/middleware <= 2.1.1; github.com/go-chi/chi/v3/middleware <= 3.3.5; github.com/go-chi/chi/v4/middleware <= 4.1.3; github.com/go-chi/chi/v5/middleware < 5.3.0; github.com/go-chi/chi/v5 < 5.3.0
- Fixed in
- 5.3.0
- Exploited in the wild
- Not in CISA KEV
- Public exploit / PoC
- None known
- Remote exploitation
- Remote, no login needed
- CVSS
- 6.9 (v4.0, CNA)CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/VI:L/VA:N/SC:N/SI:N/SA:NOpen in CVSS calculator
Show all 11 CVSS metrics
- Attack vector: Network
- Attack complexity: Low
- Attack requirements: None
- Privileges required: None
- User interaction: None
- Confidentiality impact: Low
- Integrity impact: Low
- Availability impact: None
- Confidentiality impact on other systems: None
- Integrity impact on other systems: None
- Availability impact on other systems: None
- EPSS
- 0.30% chance of exploitation in 30 days (percentile 15, 2026-11-26)
- CWE
- CWE-290
- Modified
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.
Affected and fixed versions
| Package / product | Affected | Fixed | Source |
|---|---|---|---|
| Go github.com/go-chi/chi/middleware | <= 1.5.5 | — | osv |
| Go github.com/go-chi/chi/v2/middleware | <= 2.1.1 | — | osv |
| Go github.com/go-chi/chi/v3/middleware | <= 3.3.5 | — | osv |
| Go github.com/go-chi/chi/v4/middleware | <= 4.1.3 | — | osv |
| Go github.com/go-chi/chi/v5/middleware | < 5.3.0 | 5.3.0 | osv |
| Go github.com/go-chi/chi/v5 | < 5.3.0 | 5.3.0 | osv |
| go-chi chi | < 5.3.0 | — | cvelist |
Check your systems with an agent
Paste this into Claude Code, Cursor or another coding agent. It only reads; it changes nothing.
Check whether anything I run is affected by CVE-2026-72816. Work read-only: do not install, upgrade, delete or change anything. Details: https://flawdb.com/CVE-2026-72816.md Affected: github.com/go-chi/chi/middleware <= 1.5.5; github.com/go-chi/chi/v2/middleware <= 2.1.1; github.com/go-chi/chi/v3/middleware <= 3.3.5; github.com/go-chi/chi/v4/middleware <= 4.1.3; github.com/go-chi/chi/v5/middleware < 5.3.0; github.com/go-chi/chi/v5 < 5.3.0 Fixed in: 5.3.0 Steps: 1. Search this machine and project for github.com/go-chi/chi/middleware (Go), github.com/go-chi/chi/v2/middleware (Go), github.com/go-chi/chi/v3/middleware (Go), github.com/go-chi/chi/v4/middleware (Go), github.com/go-chi/chi/v5/middleware (Go), github.com/go-chi/chi/v5 (Go): dependency manifests and lockfiles, installed packages, container images and running services. 2. For each match, note the installed version and whether it is inside the affected range. 3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
References
FAQ
Is CVE-2026-72816 being exploited?
There is no confirmed exploitation: CVE-2026-72816 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.30% chance of exploitation in the next 30 days (as of 2026-11-26).
How serious is CVE-2026-72816?
Medium: CVSS 6.9 (v4.0, scored by CNA). Remote, no login needed.
Which versions are affected by CVE-2026-72816?
github.com/go-chi/chi/middleware <= 1.5.5; github.com/go-chi/chi/v2/middleware <= 2.1.1; github.com/go-chi/chi/v3/middleware <= 3.3.5; github.com/go-chi/chi/v4/middleware <= 4.1.3; github.com/go-chi/chi/v5/middleware < 5.3.0; github.com/go-chi/chi/v5 < 5.3.0.
Is there a fix for CVE-2026-72816?
Yes. Fixed in 5.3.0. Upgrade github.com/go-chi/chi/v5/middleware to 5.3.0 or later. Upgrade github.com/go-chi/chi/v5 to 5.3.0 or later.
How do I check if I'm affected by CVE-2026-72816?
Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.