Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix: resolve client IP from the rightmost untrusted X-Forwarded-For entry (backport 2.33) - #27237

Merged
mtojek merged 1 commit into
release/2.33from
cherry-pick/26646/release/2.33
Jul 16, 2026
Merged

fix: resolve client IP from the rightmost untrusted X-Forwarded-For entry (backport 2.33)#27237
mtojek merged 1 commit into
release/2.33from
cherry-pick/26646/release/2.33

Conversation

@BobbyHo

@BobbyHo BobbyHo commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Backports #26646 to release/2.33 (Security Support).

A client could spoof its X-Forwarded-For value by prepending a fake IP; getRemoteAddress took the leftmost comma-delimited token, so appending proxies (nginx, ALB, Cloudflare) never overrode the spoofed value. This fed httpmw.RateLimit (per-IP login throttling) and audit log IPAddress fields, enabling rate-limit bypass and audit falsification.

This is the security fix tracked in PLAT-258 / coder/security-disclosures#9 (SEC-FC61DF2BF7). It already shipped in mainline (v2.35.0); this PR brings it to the Security Support line.

Clean cherry-pick, no conflicts. coderd/httpmw/realip_test.go covers the spoofing scenario.

@BobbyHo
BobbyHo marked this pull request as ready for review July 14, 2026 15:47
@mtojek
mtojek merged commit 37ef2e5 into release/2.33 Jul 16, 2026
53 of 55 checks passed
@mtojek
mtojek deleted the cherry-pick/26646/release/2.33 branch July 16, 2026 07:05
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 16, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants