Skip to content

Potential fix for code scanning alert no. 106: Disabled Spring CSRF protection#3946

Merged
strehle merged 6 commits into
developfrom
alert-autofix-106
Jun 18, 2026
Merged

Potential fix for code scanning alert no. 106: Disabled Spring CSRF protection#3946
strehle merged 6 commits into
developfrom
alert-autofix-106

Conversation

@strehle

@strehle strehle commented Jun 12, 2026

Copy link
Copy Markdown
Member

Potential fix for https://github.com/cloudfoundry/uaa/security/code-scanning/106

General fix: do not disable CSRF globally on this security chain. For Spring Security, the safest default is to leave CSRF enabled unless there is a tightly scoped and well-justified ignore rule.

Best fix here without broad functional redesign: remove the explicit disable call from ratelimitSecurity(...) so Spring’s default CSRF protection remains active for this filter chain.

File/region to change

  • server/src/main/java/org/cloudfoundry/identity/uaa/ratelimiting/beans/RateLimiterSecurityConfiguration.java
  • In method ratelimitSecurity(HttpSecurity http), remove .csrf(CsrfConfigurer::disable).
  • Also remove the now-unused CsrfConfigurer import.

No new methods, classes, or dependencies are required.

Suggested fixes powered by Copilot Autofix. Review carefully before merging.

…rotection

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@strehle strehle requested review from a team and Copilot June 12, 2026 16:08

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

This PR addresses code scanning alert #106 by no longer globally disabling Spring Security CSRF protection on the rate limiting status security filter chain, allowing Spring’s default CSRF protection to apply.

Changes:

  • Removed explicit .csrf(CsrfConfigurer::disable) from the ratelimitSecurity(HttpSecurity http) filter chain so CSRF is no longer disabled on that chain.
  • Removed the now-unused CsrfConfigurer import.

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 1 out of 1 changed files in this pull request and generated 2 comments.

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 1 out of 1 changed files in this pull request and generated 1 comment.

@strehle strehle requested a review from Copilot June 17, 2026 16:09
@strehle strehle marked this pull request as ready for review June 17, 2026 16:13

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 1 out of 1 changed files in this pull request and generated 1 comment.

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 1 out of 1 changed files in this pull request and generated 1 comment.

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 1 out of 1 changed files in this pull request and generated 1 comment.

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 1 out of 1 changed files in this pull request and generated no new comments.

@github-project-automation github-project-automation Bot moved this from Inbox to Pending Merge | Prioritized in Foundational Infrastructure Working Group Jun 18, 2026
@strehle strehle merged commit fdd1c2b into develop Jun 18, 2026
26 checks passed
@strehle strehle deleted the alert-autofix-106 branch June 18, 2026 14:13
@github-project-automation github-project-automation Bot moved this from Pending Merge | Prioritized to Done in Foundational Infrastructure Working Group Jun 18, 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