Skip to content

Commit 7b8ca30

Browse files
committed
Python: Make behaviour of taint-tracking sanitizers and extensions less surprising for the unlikely case of mutliple configurations.
1 parent 7aef32e commit 7b8ca30

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

python/ql/src/semmle/python/security/TaintTracking.qll

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,9 @@ abstract class Sanitizer extends string {
323323
* there are no `TaintTracking::Configuration`s.
324324
*/
325325
private predicate valid_sanitizer(Sanitizer sanitizer) {
326-
forall (TaintTracking::Configuration c | c.isSanitizer(sanitizer))
326+
not exists(TaintTracking::Configuration c)
327+
or
328+
exists(TaintTracking::Configuration c | c.isSanitizer(sanitizer))
327329
}
328330

329331
/** DEPRECATED -- Use DataFlowExtension instead.
@@ -850,7 +852,11 @@ library module TaintFlowImplementation {
850852
or
851853
exists(DataFlowNode fromnodenode |
852854
fromnodenode = fromnode.getNode() and
853-
forall(TaintTracking::Configuration c | c.isExtension(fromnodenode))
855+
(
856+
not exists(TaintTracking::Configuration c)
857+
or
858+
exists(TaintTracking::Configuration c | c.isExtension(fromnodenode))
859+
)
854860
|
855861
fromnodenode.getASuccessorNode() = tonode and
856862
fromnode.getContext() = tocontext and

0 commit comments

Comments
 (0)