CVE-2026-72816

go-chi chi before 5.3.0 IP Spoofing via RealIP Middleware

Published Aug 14, 2026 CVSS 4.0 · 6.9 Medium EPSS < 1% KEV · Not listed
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.

Analysis

AI-generated

Technical impact

The vulnerability in the RealIP middleware of go-chi/chi allows any party that can send HTTP requests to the application to supply arbitrary IP addresses in the headers True-Client-IP, X-Real-IP, and X-Forwarded-For. The middleware blindly copies these values into the request’s RemoteAddr field without checking that the request came from a trusted proxy. As a result, attackers can forge remote client addresses, bypass IP‑based access controls, evade rate limiting or geo‑IP restrictions, and contaminate audit logs with false client origins.

Affected Systems

All installations of go-chi/chi released through version 5.2.1 are affected. The issue was fixed in version 5.3.0 and later releases.

Risk and Exploitability

With a CVSS score of 6.9, this flaw poses a moderate risk. The EPSS score is 0.00219 (<1%) and the vulnerability is not listed in the CISA KEV catalog. The likely attack vector is via any HTTP request that reaches the RealIP middleware; an attacker can craft requests with malicious header values to trick the application into treating a spoofed IP as the client’s true address. Successful exploitation requires the application to rely on the RemoteAddr value for security decisions, which is common in many deployments. The lack of a trusted‑proxy check allows attackers to override legitimate IP checks with ease.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade to go-chi/chi version 5.3.0 or later.
  • Configure the RealIP middleware to accept headers strictly from a trusted proxy or internal network.
  • If upgrade is not immediately possible, temporarily remove or disable the RealIP middleware, or enforce strict IP validation before using RemoteAddr.

Generated by OpenCVE AI on August 22, 2026 at 10:06 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'yes', 'Exploitation': 'poc', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
First Time appeared Go-chi
Go-chi chi
Vendors & Products Go-chi
Go-chi chi
Type Values Removed Values Added
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.
Title go-chi chi before 5.3.0 IP Spoofing via RealIP Middleware
Weaknesses CWE-290
References
Metrics cvssV3_1

{'score': 6.5, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N'}

cvssV4_0

{'score': 6.9, 'vector': 'CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/VI:L/VA:N/SC:N/SI:N/SA:N'}

Weaknesses
  • CWE-290

    Authentication Bypass by Spoofing

  • CWE-346

    Origin Validation Error

Sources

Status
PUBLISHED
Assigner
VulnCheck
Published
Updated
Oct 8, 2026, 3:24 PM
Reserved
Aug 10, 2026, 3:12 PM
Status
Deferred
Published
Aug 14, 2026, 12:16 PM
Modified
Oct 8, 2026, 4:17 PM
Severity
Moderate
Public date
Aug 14, 2026, 11:35 AM