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.
Published: 2026-08-14
Score: 6.9 Medium
EPSS: n/a
KEV: No
Impact: n/a
Action: n/a
AI Analysis

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 not available 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.

Generated by OpenCVE AI on August 14, 2026 at 12:53 UTC.

Remediation

No vendor fix or workaround currently provided.

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 14, 2026 at 12:53 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

Fri, 14 Aug 2026 13:15:00 +0000

Type Values Removed Values Added
First Time appeared Go-chi
Go-chi chi
Vendors & Products Go-chi
Go-chi chi

Fri, 14 Aug 2026 11:45:00 +0000

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'}


cve-icon MITRE

Status: PUBLISHED

Assigner: VulnCheck

Published:

Updated: 2026-08-14T11:35:28.145Z

Reserved: 2026-08-10T15:12:16.754Z

Link: CVE-2026-72816

cve-icon Vulnrichment

No data.

cve-icon NVD

Status : Received

Published: 2026-08-14T12:16:44.620

Modified: 2026-08-14T12:16:44.620

Link: CVE-2026-72816

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-08-14T13:00:11Z

Weaknesses
  • CWE-290

    Authentication Bypass by Spoofing