CVE-2026-72816

Description

A flaw was found in the go-chi/chi RealIP middleware. This vulnerability allows a remote attacker to perform IP spoofing by supplying arbitrary IP addresses in client-controlled headers. This can lead to bypassing IP-based access controls, evading rate limiting and geo-IP restrictions, and polluting audit logs.

Statement

An IP spoofing flaw exists in go-chi/chi's RealIP middleware (middleware/realip.go). The realIP() function parses untrusted HTTP headers (True-Client-IP, X-Real-IP, X-Forwarded-For) and overwrites r.RemoteAddr without validating upstream proxy identity. Remote unauthenticated attackers can supply arbitrary IP values in these headers to bypass IP-restricted endpoints, subvert rate-limiting controls, or poison application audit logs, posing a Low impact to confidentiality and integrity.

Mitigation

Do not use the `chi/middleware.RealIP` middleware when receiving traffic directly from untrusted networks or unverified proxies. Instead, strip or sanitize client-supplied forwarding headers at an upstream edge proxy or reverse proxy (such as NGINX or HAProxy) before requests reach the application.

Common Vulnerability Scoring System (CVSS) Score Details

Info alert:Important note

CVSS scores for open source components depend on vendor-specific factors (e.g. version or build chain). Therefore, Red Hat's score and impact rating can be different from NVD and other vendors. Red Hat remains the authoritative CVE Naming Authority (CNA) source for its products and services (see Red Hat classifications).

CVSS v3 Score Breakdown

Red HatNVDcve.org
Base Score6.5N/A6.5
Attack VectorNetworkN/ANetwork
Attack ComplexityLowN/ALow
Privileges RequiredNoneN/ANone
User InteractionNoneN/ANone
ScopeUnchangedN/AUnchanged
ConfidentialityLowN/ALow
Integrity ImpactLowN/ALow
Availability ImpactNoneN/ANone

Vector

Red Hat: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N

cve.org: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N

Understanding the Weakness (CWE)

Access Control,Other

Technical Impact: Gain Privileges or Assume Identity; Varies by Context

An attacker can access any functionality that is inadvertently accessible to the source.

Frequently Asked Questions

Want to get errata notifications? Sign up here.