We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
DsnInjection
1 parent 2578ef4 commit 36b1a0dCopy full SHA for 36b1a0d
go/ql/src/experimental/CWE-74/DsnInjectionCustomizations.qll
@@ -32,8 +32,11 @@ private module DsnInjectionConfig implements DataFlow::ConfigSig {
32
predicate isSource(DataFlow::Node source) { source instanceof Source }
33
34
predicate isSink(DataFlow::Node sink) {
35
- exists(Function f | f.hasQualifiedName("database/sql", "Open") |
36
- sink = f.getACall().getArgument(1)
+ exists(DataFlow::CallNode c |
+ c.getTarget().hasQualifiedName("database/sql", "Open") and
37
+ c.getArgument(0).getStringValue() = "mysql"
38
+ |
39
+ sink = c.getArgument(1)
40
)
41
}
42
0 commit comments