Skip to content

chi middleware RealIP is deprecated #3082

Open

Description

@butonic

We use it to determine the client ip for logs and rego checks:

RealIP is a middleware that sets a http.Request's RemoteAddr to the results of parsing either the True-Client-IP, X-Real-IP or the X-Forwarded-For headers (in that order).

Deprecated: RealIP is vulnerable to IP spoofing — it mutates r.RemoteAddr to the leftmost X-Forwarded-For value, or to True-Client-IP / X-Real-IP whether or not your infrastructure actually sets them. See GHSA-3fxj-6jh8-hvhx, GHSA-rjr7-jggh-pgcp, GHSA-9g5q-2w5x-hmxf.

Use ClientIPFromHeader, ClientIPFromXFF, ClientIPFromXFFTrustedProxies or ClientIPFromRemoteAddr and read the IP with GetClientIP instead. These never mutate r.RemoteAddr.

Activity

  1. added theissue type on Jul 7, 2026
  2. added
    Type:Maintenance
    on Jul 7, 2026
  3. self-assigned this
    on Sep 9, 2026
  4. moved this from Qualification to Prio <= 3 in OpenCloud Team Boardon Oct 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Priority:p3-mediumType:BugType:Maintenance

Type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions