Skip to content
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

fix: correctly identify infixed concats as potential SQL injections #987

Merged
merged 9 commits into from
Jul 25, 2023

Conversation

audunmo
Copy link
Contributor

@audunmo audunmo commented Jul 21, 2023

This doesn't have an issue, popped up while I was investigating #885

In some cases, gosec fails to fully evaluate statements where string concatenations contain variable components. This leads to it missing potential SQL injection vulnerabilities that are "infixed", i.e. "INSERT INTO foo VALUES (name) ('" + os.Args[0] + "')"

rules/rulelist.go Outdated Show resolved Hide resolved
rules/sql.go Outdated Show resolved Hide resolved
helpers.go Outdated Show resolved Hide resolved
helpers.go Outdated Show resolved Hide resolved
@ccojocar
Copy link
Member

Also please fix the lint warnings. You can run the golanci-lint locally.

@audunmo
Copy link
Contributor Author

audunmo commented Jul 25, 2023

@ccojocar thanks for the review, will fix

@audunmo audunmo requested a review from ccojocar July 25, 2023 11:32
@ccojocar ccojocar merged commit bf7feda into securego:master Jul 25, 2023
6 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.

None yet

2 participants