---
id: "GHSA-7cgw-qmxx-7fc2"
kind: "vulnerability"
aliases: ["GHSA-7cgw-qmxx-7fc2"]
title: "Duplicate Advisory: chi: Client IP spoofing in ClientIPFromXFF via X-Forwarded-For"
severity: "medium"
cvss: 4.8
epss: null
exploited: false
status: "withdrawn"
category: "package"
products: [{"name": "github.com/go-chi/chi/v5", "fixed": [], "affected": "<= 5.3.2", "ecosystem": "go"}]
ecosystems: ["go"]
tags: ["chi", "cwe-348", "go", "package", "self-hosted"]
not_affected_if: ["behind-trusted-proxy-only", "not-using-clientipfromxff"]
published_at: "2026-10-21T15:42:31+00:00"
first_seen_at: "2026-10-23T20:59:05+00:00"
updated_at: "2026-10-23T21:00:25+00:00"
sources: [{"source": "ghsa", "url": "https://github.com/advisories/GHSA-7cgw-qmxx-7fc2", "first_seen_at": "2026-10-23T20:59:05+00:00"}]
---

# Duplicate Advisory: chi: Client IP spoofing in ClientIPFromXFF via X-Forwarded-For

This advisory is withdrawn as a duplicate of GHSA-j6qf-3m9c-vwj3 and describes the chi Go router's ClientIPFromXFF middleware not checking that the direct TCP peer is a trusted proxy. An attacker who can reach the Go server directly can forge the client IP that the middleware returns.

_Summary, check and fix written by a model from the sources; labelled as such._

## Affected

- go:github.com/go-chi/chi/v5 affected <= 5.3.2 fixed ?

## How to check

Run go list -m github.com/go-chi/chi/v5 in each Go module and check whether the version is 5.3.2 or lower.
Search the code for ClientIPFromXFF or middleware.GetClientIP.

## Fix

Upgrade github.com/go-chi/chi/v5 to 5.4.0 or later, per the description.
Follow GHSA-j6qf-3m9c-vwj3, the canonical advisory, for current guidance.

## Timeline

- 2026-10-23T20:59:05+00:00 ghsa https://github.com/advisories/GHSA-7cgw-qmxx-7fc2

## From the sources

## Duplicate Advisory

This advisory has been withdrawn because it is a duplicate of GHSA-j6qf-3m9c-vwj3. This link is maintained to preserve external references.

## Original Description
In the Golang Chi web framework, the ClientIPFromXFF middleware skips any X-Forwarded-For entry in a configured trusted CIDR but never verifies that the direct TCP peer in http.Request.RemoteAddr belongs to that CIDR. A client that can reach the Go server directly can therefore append a trusted-looking proxy address and choose the client IP returned by middleware.GetClientIP.

This issue affects chi before 5.4.0.

---

_Free to read at a human pace. An API with keys and an MCP server are in preparation; early access: hello@infrastack.ai_
