Skip to content

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

Closed
cheestree wants to merge 1 commit into
mainfrom
alert-autofix-1
Closed

Potential fix for code scanning alert no. 1: Disabled Spring CSRF protection#115
cheestree wants to merge 1 commit into
mainfrom
alert-autofix-1

Conversation

@cheestree

Copy link
Copy Markdown
Owner

Potential fix for https://github.com/cheestree/vetly/security/code-scanning/1

The best fix is to remove explicit CSRF disabling in the dev security chain so Spring Security’s default CSRF protection remains active. This preserves existing behavior as much as possible while eliminating the vulnerability pattern flagged by CodeQL.

Concretely, in src/server/src/main/kotlin/com/cheestree/vetly/config/SecurityConfig.kt, edit devSecurityFilterChain and delete the line:

  • .csrf { it.disable() }

No new methods or imports are required. Spring will apply its default CSRF protection automatically.

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>
@cheestree cheestree closed this Jul 2, 2026
@cheestree
cheestree deleted the alert-autofix-1 branch July 2, 2026 23:06
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