Skip to content

Commit 36b1a0d

Browse files
committed
Update for recent changes to DsnInjection
1 parent 2578ef4 commit 36b1a0d

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

go/ql/src/experimental/CWE-74/DsnInjectionCustomizations.qll

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,11 @@ private module DsnInjectionConfig implements DataFlow::ConfigSig {
3232
predicate isSource(DataFlow::Node source) { source instanceof Source }
3333

3434
predicate isSink(DataFlow::Node sink) {
35-
exists(Function f | f.hasQualifiedName("database/sql", "Open") |
36-
sink = f.getACall().getArgument(1)
35+
exists(DataFlow::CallNode c |
36+
c.getTarget().hasQualifiedName("database/sql", "Open") and
37+
c.getArgument(0).getStringValue() = "mysql"
38+
|
39+
sink = c.getArgument(1)
3740
)
3841
}
3942

0 commit comments

Comments
 (0)