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

Go: Add SQLi sinks for Squirrel #15812

Merged
merged 2 commits into from
Mar 6, 2024

Conversation

atorralba
Copy link
Contributor

Adds SQL injection sinks for https://github.com/Masterminds/squirrel.

smowton
smowton previously approved these changes Mar 5, 2024
fn.(Method).hasQualifiedName(sq, builder, "Where")
// first argument to the `OrderBy`, `Prefix`, `Suffix` or `Where` method of one of the `*Builder` classes
exists(Method m, string builder | m = fn |
builder.matches("%Builder") and
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While you're editing this code, can you just explicitly list the types? It makes it much easier to search for and there aren't that many.

Copy link
Contributor

@owen-mc owen-mc Mar 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's this:

Suggested change
builder.matches("%Builder") and
builder = ["DeleteBuilder", "InsertBuilder", "SelectBuilder", "UpdateBuilder"] and

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, done here: e78e71c.

@atorralba atorralba merged commit f4c2e65 into github:main Mar 6, 2024
14 checks passed
@atorralba atorralba deleted the atorralba/go/squirrel-sinks branch March 6, 2024 11:09
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.

Unable to detect SQL injection vulnerability in gorm framework in go language
3 participants