Skip to content

Conversation

@smowton
Copy link
Contributor

@smowton smowton commented Dec 8, 2025

No description provided.

@smowton smowton requested a review from a team as a code owner December 8, 2025 11:51
Copilot AI review requested due to automatic review settings December 8, 2025 11:51
@github-actions github-actions bot added the C# label Dec 8, 2025
Copy link
Contributor

Copilot AI left a comment

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 extends the C# CSRF security query to detect missing anti-forgery token validation in ASP.NET Core applications, in addition to the existing ASP.NET MVC support.

Key changes:

  • Added ASP.NET Core framework support to the CSRF detection query
  • Refactored validation logic to handle both ASP.NET MVC and ASP.NET Core patterns
  • Added comprehensive test cases for ASP.NET Core scenarios

Reviewed changes

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

Show a summary per file
File Description
MissingAntiForgeryTokenValidation.ql Extended query logic to detect CSRF vulnerabilities in both ASP.NET MVC and ASP.NET Core controllers
MissingAntiForgeryTokenValidation.cs Added test cases demonstrating vulnerable and safe ASP.NET Core controller patterns
MissingAntiForgeryTokenValidation.expected Expected query results for the new ASP.NET Core test cases
MissingAntiForgeryTokenValidation.qlref Query reference file for test execution
options Extractor configuration for ASP.NET Core test compilation

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@@ -0,0 +1 @@
query: Security Features/CWE-352/MissingAntiForgeryTokenValidation.ql

Check warning

Code scanning / CodeQL

Query test without inline test expectations Warning test

Query test does not use inline test expectations.
@smowton smowton merged commit ef991e5 into github:main Dec 8, 2025
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants