-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Analyzer for string concatenation in raw SQL methods. #36698
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
19e7040
to
e296172
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a few quick comments
ef8427d
to
a897c98
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM after comments addressed, thanks!
src/EFCore.Analyzers/StringsUsageInRawQueriesDiagnosticAnalyzer.cs
Outdated
Show resolved
Hide resolved
test/EFCore.Analyzers.Tests/StringsUsageInRawQueriesDiagnosticAnalyzerTests.cs
Outdated
Show resolved
Hide resolved
test/EFCore.Analyzers.Tests/StringsUsageInRawQueriesDiagnosticAnalyzerTests.cs
Outdated
Show resolved
Hide resolved
test/EFCore.Analyzers.Tests/StringsUsageInRawQueriesDiagnosticAnalyzerTests.cs
Outdated
Show resolved
Hide resolved
test/EFCore.Analyzers.Tests/StringsUsageInRawQueriesDiagnosticAnalyzerTests.cs
Outdated
Show resolved
Hide resolved
a897c98
to
3fc2434
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved. RC2. Breaking change?
@artl93 Not a breaking change. |
Fixes #35735.
Description
Doing string concatenation in raw SQL methods is dangerous, because it open possibility of SQL injection. We had analyzer for string interpolation, but not pure string concatenation. This fixed it.
Customer impact
Customers might be unknowingly open to SQL injection attacks.
How found
Customer reported.
Regression
No.
Testing
Tests added.
Risk
Low. This is only analyzers package.