Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Address review comments
  • Loading branch information
owen-mc committed Mar 27, 2025
commit 8bc70be3c78a2282ee992f113a89863b7205c649
2 changes: 2 additions & 0 deletions go/ql/lib/ext/github.com.masterminds.squirrel.model.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,5 @@ extensions:
- ["group:squirrel", "UpdateBuilder", True, "Suffix", "", "", "Argument[0]", "sql-injection", "manual"]
- ["group:squirrel", "UpdateBuilder", True, "Table", "", "", "Argument[0]", "sql-injection", "manual"]
# UpdateBuilder.Where has to be modeled in QL to avoid FPs when a non-string argument is used

# There are summary models for Row.Scan, RowScanner.Scan, {Insert,Delete,Select,Update}Builder.Scan and {Insert,Delete,Select,Update}Builder.ScanContext modeled in QL
4 changes: 2 additions & 2 deletions go/ql/lib/semmle/go/frameworks/Squirrel.qll
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ module Squirrel {
FunctionOutput outp;

BuilderScan() {
// signature: func (b InsertBuilder) Scan(dest ...interface{}) error
// signature: func (b {Insert,Delete,Select,Update}Builder) Scan(dest ...interface{}) error
this.hasQualifiedName(packagePath(),
["DeleteBuilder", "InsertBuilder", "SelectBuilder", "UpdateBuilder"], "Scan") and
inp.isReceiver() and
Expand All @@ -71,7 +71,7 @@ module Squirrel {
FunctionOutput outp;

BuilderScanContext() {
// signature: func (b InsertBuilder) ScanContext(ctx context.Context, dest ...interface{}) error
// signature: func (b {Insert,Delete,Select,Update}Builder) ScanContext(ctx context.Context, dest ...interface{}) error
this.hasQualifiedName(packagePath(),
["DeleteBuilder", "InsertBuilder", "SelectBuilder", "UpdateBuilder"], "ScanContext") and
inp.isReceiver() and
Expand Down