Skip to content

Conversation

@MathiasVP
Copy link
Collaborator

@MathiasVP MathiasVP commented Oct 1, 2025

While validating results for ps/sql-injection I noticed lots and lots of results of the form:

param($query)
...
Invoke-Sqlcmd -q $query

This is obviously bad, but it's impossible to tell if there is some validation going on prior to this being inputted to PowerShell. So instead, this PR changes the query so that it requires a string concatenation to be present along the path. So the above is not longer flagged, but this is:

param($value)
...
Invoke-Sqlcmd -q "SELECT * FROM customers WHERE id = $value"

Commit-by-commit review recommended. While doing this I noticed that we didn't have flow through the subexpression operator. So I added that in bfb10a2

@chanel-y chanel-y merged commit 4ab6f5c into main Oct 2, 2025
4 checks passed
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.

3 participants