Skip to content

Commit d92acec

Browse files
committed
Python: mass enable diff-informed data flow
1 parent 28f3073 commit d92acec

File tree

55 files changed

+197
-1
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+197
-1
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ private module CleartextLoggingConfig implements DataFlow::ConfigSig {
2121
predicate isSink(DataFlow::Node sink) { sink instanceof Sink }
2222

2323
predicate isBarrier(DataFlow::Node node) { node instanceof Sanitizer }
24+
25+
predicate observeDiffInformedIncrementalMode() { any() }
2426
}
2527

2628
/** Global taint-tracking for detecting "Clear-text logging of sensitive information" vulnerabilities. */

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ private module CleartextStorageConfig implements DataFlow::ConfigSig {
2121
predicate isSink(DataFlow::Node sink) { sink instanceof Sink }
2222

2323
predicate isBarrier(DataFlow::Node node) { node instanceof Sanitizer }
24+
25+
predicate observeDiffInformedIncrementalMode() { any() }
2426
}
2527

2628
/** Global taint-tracking for detecting "Clear-text storage of sensitive information" vulnerabilities. */

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ private module CodeInjectionConfig implements DataFlow::ConfigSig {
1717
predicate isSink(DataFlow::Node sink) { sink instanceof Sink }
1818

1919
predicate isBarrier(DataFlow::Node node) { node instanceof Sanitizer }
20+
21+
predicate observeDiffInformedIncrementalMode() { any() }
2022
}
2123

2224
/** Global taint-tracking for detecting "code injection" vulnerabilities. */

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ module CommandInjectionConfig implements DataFlow::ConfigSig {
2020
predicate isSink(DataFlow::Node sink) { sink instanceof Sink }
2121

2222
predicate isBarrier(DataFlow::Node node) { node instanceof Sanitizer }
23+
24+
predicate observeDiffInformedIncrementalMode() { any() }
2325
}
2426

2527
/** Global taint-tracking for detecting "command injection" vulnerabilities. */

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ module CookieInjectionConfig implements DataFlow::ConfigSig {
2020
predicate isSink(DataFlow::Node sink) { sink instanceof Sink }
2121

2222
predicate isBarrier(DataFlow::Node node) { node instanceof Sanitizer }
23+
24+
predicate observeDiffInformedIncrementalMode() { any() }
2325
}
2426

2527
/** Global taint-tracking for detecting "cookie injection" vulnerabilities. */

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ private module HeaderInjectionConfig implements DataFlow::ConfigSig {
1616
predicate isSink(DataFlow::Node node) { node instanceof HttpHeaderInjection::Sink }
1717

1818
predicate isBarrier(DataFlow::Node node) { node instanceof HttpHeaderInjection::Sanitizer }
19+
20+
predicate observeDiffInformedIncrementalMode() { any() }
1921
}
2022

2123
/** Global taint-tracking for detecting "HTTP Header injection" vulnerabilities. */

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

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,13 @@ private module LdapInjectionDnConfig implements DataFlow::ConfigSig {
1919
predicate isSink(DataFlow::Node sink) { sink instanceof DnSink }
2020

2121
predicate isBarrier(DataFlow::Node node) { node instanceof DnSanitizer }
22+
23+
predicate observeDiffInformedIncrementalMode() {
24+
// TODO(diff-informed): Manually verify if config can be diff-informed.
25+
// ql/src/Security/CWE-090/LdapInjection.ql:26: Column 1 does not select a source or sink originating from the flow call on line 21
26+
// ql/src/Security/CWE-090/LdapInjection.ql:27: Column 5 does not select a source or sink originating from the flow call on line 21
27+
none()
28+
}
2229
}
2330

2431
/** Global taint-tracking for detecting "LDAP injection via the distinguished name (DN) parameter" vulnerabilities. */
@@ -30,6 +37,13 @@ private module LdapInjectionFilterConfig implements DataFlow::ConfigSig {
3037
predicate isSink(DataFlow::Node sink) { sink instanceof FilterSink }
3138

3239
predicate isBarrier(DataFlow::Node node) { node instanceof FilterSanitizer }
40+
41+
predicate observeDiffInformedIncrementalMode() {
42+
// TODO(diff-informed): Manually verify if config can be diff-informed.
43+
// ql/src/Security/CWE-090/LdapInjection.ql:26: Column 1 does not select a source or sink originating from the flow call on line 24
44+
// ql/src/Security/CWE-090/LdapInjection.ql:27: Column 5 does not select a source or sink originating from the flow call on line 24
45+
none()
46+
}
3347
}
3448

3549
/** Global taint-tracking for detecting "LDAP injection via the filter parameter" vulnerabilities. */

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ private module LogInjectionConfig implements DataFlow::ConfigSig {
1717
predicate isSink(DataFlow::Node sink) { sink instanceof Sink }
1818

1919
predicate isBarrier(DataFlow::Node node) { node instanceof Sanitizer }
20+
21+
predicate observeDiffInformedIncrementalMode() { any() }
2022
}
2123

2224
/** Global taint-tracking for detecting "log injection" vulnerabilities. */

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ module NoSqlInjectionConfig implements DataFlow::StateConfigSig {
5656
predicate isBarrier(DataFlow::Node node) {
5757
node = any(NoSqlSanitizer noSqlSanitizer).getAnInput()
5858
}
59+
60+
predicate observeDiffInformedIncrementalMode() { any() }
5961
}
6062

6163
module NoSqlInjectionFlow = TaintTracking::GlobalWithState<NoSqlInjectionConfig>;

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ private module PamAuthorizationConfig implements DataFlow::ConfigSig {
3131
// Flow from handle to the authenticate call in the final step
3232
exists(VulnPamAuthCall c | c.getArg(0) = node1 | node2 = c)
3333
}
34+
35+
predicate observeDiffInformedIncrementalMode() { any() }
3436
}
3537

3638
/** Global taint-tracking for detecting "PAM Authorization" vulnerabilities. */

0 commit comments

Comments
 (0)