False positive for CA2100 #4735
Labels
Area-Microsoft.CodeAnalysis.NetAnalyzers
Bug
The product is not behaving according to its current intended design
DataFlow
help wanted
The issue is up-for-grabs, and can be claimed by commenting
Milestone
Analyzer
Diagnostic ID: CA2100:
Review SQL queries for security vulnerabilities
Analyzer source
SDK: Built-in CA analyzers in .NET 5 SDK or later
Version: SDK 5.0.100
Describe the bug
A false alarm CA2100 is emitted by security analyzer when command text uses text substitution
Steps To Reproduce
Simply compile the following code:
Expected behavior
No warning is emitted, the code does not allow for SQL injection
Actual behavior
CA2100 is emitted, the analyzer is unhappy with first line after the 'WHERE' statement. Although this is constant and is not something that provided "externally"
Additional context
To solve the warning you would have to do (and change the query to include @x)
The text was updated successfully, but these errors were encountered: