Skip to content

Potential fix for code scanning alert no. 1: Disabled Spring CSRF protection#2

Merged
tatilimongi merged 1 commit into
mainfrom
alert-autofix-1
May 17, 2025
Merged

Potential fix for code scanning alert no. 1: Disabled Spring CSRF protection#2
tatilimongi merged 1 commit into
mainfrom
alert-autofix-1

Conversation

@tatilimongi

Copy link
Copy Markdown
Collaborator

Potential fix for https://github.com/CalingoTeam/Back-End/security/code-scanning/1

To fix the issue, CSRF protection should be enabled by removing the csrf.disable() call. If there are specific endpoints that need to bypass CSRF protection (e.g., for APIs accessed programmatically), they can be explicitly excluded using Spring Security's ignoringAntMatchers or similar configurations. This ensures that CSRF protection is applied to all other endpoints.

The changes will involve:

  1. Removing the csrf.disable() call on line 31.
  2. Optionally, configuring CSRF protection to ignore specific endpoints if necessary.

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

…tection

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@tatilimongi tatilimongi marked this pull request as ready for review May 17, 2025 01:43
@tatilimongi tatilimongi merged commit ec1d46d into main May 17, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant