Skip to content

Commit 9769668

Browse files
committed
Python: require dict sinks be dangerous.
1 parent f3a0161 commit 9769668

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

python/ql/lib/semmle/python/security/dataflow/NoSQLInjectionCustomizations.qll

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,11 @@ module NoSqlInjection {
7777

7878
/** A NoSQL query that is vulnerable to user controlled dictionaries. */
7979
class NoSqlExecutionAsDictSink extends DictSink {
80-
NoSqlExecutionAsDictSink() { this = any(NoSqlExecution noSqlExecution).getQuery() }
80+
NoSqlExecutionAsDictSink() {
81+
exists(NoSqlExecution noSqlExecution | this = noSqlExecution.getQuery() |
82+
noSqlExecution.interpretsDict()
83+
)
84+
}
8185
}
8286

8387
/** A JSON decoding converts a string to a dictionary. */

0 commit comments

Comments
 (0)