Skip to content

Conversation

cincuranet
Copy link
Contributor

@cincuranet cincuranet commented Sep 2, 2025

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.

@cincuranet cincuranet changed the title Concat analyzer Analyzer for string concatenation in raw SQL methods. Sep 2, 2025
Copy link
Member

@roji roji left a 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

@cincuranet cincuranet force-pushed the concat-analyzer branch 5 times, most recently from ef8427d to a897c98 Compare September 9, 2025 09:56
@cincuranet cincuranet marked this pull request as ready for review September 9, 2025 09:56
@cincuranet cincuranet requested a review from a team as a code owner September 9, 2025 09:56
Copy link
Member

@roji roji left a 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!

Copy link
Member

@artl93 artl93 left a 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?

@cincuranet
Copy link
Contributor Author

@artl93 Not a breaking change.

@cincuranet cincuranet merged commit 9a44870 into dotnet:release/10.0 Sep 10, 2025
7 checks passed
@cincuranet cincuranet deleted the concat-analyzer branch September 10, 2025 06:37
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.

Analyzer warnings for string concatenation in raw SQL APIs
4 participants