Skip to content

fix: block spoofable IP headers (X-Client-IP, X-Real-IP) from rate limiting - #4001

Merged
strehle merged 3 commits into
developfrom
ip-fix
Jul 29, 2026
Merged

fix: block spoofable IP headers (X-Client-IP, X-Real-IP) from rate limiting#4001
strehle merged 3 commits into
developfrom
ip-fix

Conversation

@strehle

@strehle strehle commented Jul 25, 2026

Copy link
Copy Markdown
Member

fix: block spoofable IP headers (X-Client-IP, X-Real-IP) from rate limiting

Add X-Client-IP and X-Real-IP to the default filteredHeaders list so these headers are stripped from incoming requests before rate-limiting logic reads the client IP, preventing spoofing via untrusted proxy headers.

…miting

Add X-Client-IP and X-Real-IP to the default filteredHeaders list so these
headers are stripped from incoming requests before rate-limiting logic reads
the client IP, preventing spoofing via untrusted proxy headers.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adjusts UAA’s default servlet header-filtering configuration to include X-Client-IP and X-Real-IP, intending to prevent untrusted client-supplied IP headers from influencing rate-limiting identity.

Changes:

  • Extend servlet.filteredHeaders default list to include X-Client-IP and X-Real-IP.
  • Update UaaPropertiesTest to assert the new default header list.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
server/src/main/java/org/cloudfoundry/identity/uaa/UaaProperties.java Adds X-Client-IP and X-Real-IP to the default servlet.filteredHeaders list.
server/src/test/java/org/cloudfoundry/identity/uaa/UaaPropertiesTest.java Updates default-value assertion to include the newly filtered headers.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.

@strehle
strehle requested review from duanemay and fhanik July 27, 2026 14:06

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (1)

server/src/main/java/org/cloudfoundry/identity/uaa/SpringServletXmlSecurityConfiguration.java:205

  • The comment references RateLimiterImpl.getClientIP(), but RateLimiterImpl has no such method (it delegates to RequestInfoImpl.from(request) and downstream uses RequestInfo#getClientIP()). This makes the comment misleading when someone tries to trace the behavior.
        // headerFilter must run before rateLimitingFilter: it strips spoofable IP headers (X-Client-IP, X-Real-IP)
        // so that RateLimiterImpl.getClientIP() cannot be influenced by untrusted client-supplied values.

@github-project-automation github-project-automation Bot moved this from Inbox to Pending Merge | Prioritized in Foundational Infrastructure Working Group Jul 28, 2026
@strehle
strehle merged commit 3257758 into develop Jul 29, 2026
34 of 35 checks passed
@strehle
strehle deleted the ip-fix branch July 29, 2026 07:04
@github-project-automation github-project-automation Bot moved this from Pending Merge | Prioritized to Done in Foundational Infrastructure Working Group Jul 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

3 participants