File tree 8 files changed +33
-50
lines changed
lib/semmle/python/security/dataflow
experimental/semmle/python/libraries
8 files changed +33
-50
lines changed Original file line number Diff line number Diff line change @@ -20,12 +20,7 @@ private module LdapInjectionDnConfig implements DataFlow::ConfigSig {
20
20
21
21
predicate isBarrier ( DataFlow:: Node node ) { node instanceof DnSanitizer }
22
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
- }
23
+ predicate observeDiffInformedIncrementalMode ( ) { any ( ) }
29
24
}
30
25
31
26
/** Global taint-tracking for detecting "LDAP injection via the distinguished name (DN) parameter" vulnerabilities. */
@@ -38,12 +33,7 @@ private module LdapInjectionFilterConfig implements DataFlow::ConfigSig {
38
33
39
34
predicate isBarrier ( DataFlow:: Node node ) { node instanceof FilterSanitizer }
40
35
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
- }
36
+ predicate observeDiffInformedIncrementalMode ( ) { any ( ) }
47
37
}
48
38
49
39
/** Global taint-tracking for detecting "LDAP injection via the filter parameter" vulnerabilities. */
Original file line number Diff line number Diff line change @@ -19,10 +19,12 @@ private module RegexInjectionConfig implements DataFlow::ConfigSig {
19
19
20
20
predicate isBarrier ( DataFlow:: Node node ) { node instanceof Sanitizer }
21
21
22
- predicate observeDiffInformedIncrementalMode ( ) {
23
- // TODO(diff-informed): Manually verify if config can be diff-informed.
24
- // ql/src/Security/CWE-730/RegexInjection.ql:29: Column 7 selects sink.getRegexExecution
25
- none ( )
22
+ predicate observeDiffInformedIncrementalMode ( ) { any ( ) }
23
+
24
+ Location getASelectedSinkLocation ( DataFlow:: Node sink ) {
25
+ result = sink .( Sink ) .getLocation ( )
26
+ or
27
+ result = sink .( Sink ) .getRegexExecution ( ) .getLocation ( )
26
28
}
27
29
}
28
30
Original file line number Diff line number Diff line change @@ -30,11 +30,12 @@ private module FullServerSideRequestForgeryConfig implements DataFlow::ConfigSig
30
30
node instanceof FullUrlControlSanitizer
31
31
}
32
32
33
- predicate observeDiffInformedIncrementalMode ( ) {
34
- // TODO(diff-informed): Manually verify if config can be diff-informed.
35
- // ql/lib/semmle/python/security/dataflow/ServerSideRequestForgeryQuery.qll:47: Flow call outside 'select' clause
36
- // ql/src/Security/CWE-918/FullServerSideRequestForgery.ql:24: Column 1 selects sink.getRequest
37
- none ( )
33
+ predicate observeDiffInformedIncrementalMode ( ) { any ( ) }
34
+
35
+ Location getASelectedSinkLocation ( DataFlow:: Node sink ) {
36
+ result = sink .( Sink ) .getLocation ( )
37
+ or
38
+ result = sink .( Sink ) .getRequest ( ) .getLocation ( )
38
39
}
39
40
}
40
41
@@ -66,10 +67,12 @@ private module PartialServerSideRequestForgeryConfig implements DataFlow::Config
66
67
67
68
predicate isBarrier ( DataFlow:: Node node ) { node instanceof Sanitizer }
68
69
69
- predicate observeDiffInformedIncrementalMode ( ) {
70
- // TODO(diff-informed): Manually verify if config can be diff-informed.
71
- // ql/src/Security/CWE-918/PartialServerSideRequestForgery.ql:24: Column 1 selects sink.getRequest
72
- none ( )
70
+ predicate observeDiffInformedIncrementalMode ( ) { any ( ) }
71
+
72
+ Location getASelectedSinkLocation ( DataFlow:: Node sink ) {
73
+ result = sink .( Sink ) .getLocation ( )
74
+ or
75
+ result = sink .( Sink ) .getRequest ( ) .getLocation ( )
73
76
}
74
77
}
75
78
Original file line number Diff line number Diff line change @@ -29,11 +29,14 @@ module UnsafeShellCommandConstructionConfig implements DataFlow::ConfigSig {
29
29
// override to require the path doesn't have unmatched return steps
30
30
DataFlow:: FlowFeature getAFeature ( ) { result instanceof DataFlow:: FeatureHasSourceCallContext }
31
31
32
- predicate observeDiffInformedIncrementalMode ( ) {
33
- // TODO(diff-informed): Manually verify if config can be diff-informed.
34
- // ql/src/Security/CWE-078/UnsafeShellCommandConstruction.ql:27: Column 1 selects sink.getStringConstruction
35
- // ql/src/Security/CWE-078/UnsafeShellCommandConstruction.ql:29: Column 7 selects sink.getCommandExecution
36
- none ( )
32
+ predicate observeDiffInformedIncrementalMode ( ) { any ( ) }
33
+
34
+ Location getASelectedSinkLocation ( DataFlow:: Node sink ) {
35
+ result = sink .( Sink ) .getLocation ( )
36
+ or
37
+ result = sink .( Sink ) .getStringConstruction ( ) .getLocation ( )
38
+ or
39
+ result = sink .( Sink ) .getCommandExecution ( ) .getLocation ( )
37
40
}
38
41
}
39
42
Original file line number Diff line number Diff line change @@ -34,11 +34,7 @@ module NormalHashFunction {
34
34
sensitiveDataExtraStepForCalls ( node1 , node2 )
35
35
}
36
36
37
- predicate observeDiffInformedIncrementalMode ( ) {
38
- // TODO(diff-informed): Manually verify if config can be diff-informed.
39
- // ql/lib/semmle/python/security/dataflow/WeakSensitiveDataHashingQuery.qll:88: Flow call outside 'select' clause
40
- none ( )
41
- }
37
+ predicate observeDiffInformedIncrementalMode ( ) { any ( ) }
42
38
}
43
39
44
40
/** Global taint-tracking for detecting "use of a broken or weak cryptographic hashing algorithm on sensitive data" vulnerabilities. */
@@ -70,11 +66,7 @@ module ComputationallyExpensiveHashFunction {
70
66
sensitiveDataExtraStepForCalls ( node1 , node2 )
71
67
}
72
68
73
- predicate observeDiffInformedIncrementalMode ( ) {
74
- // TODO(diff-informed): Manually verify if config can be diff-informed.
75
- // ql/lib/semmle/python/security/dataflow/WeakSensitiveDataHashingQuery.qll:95: Flow call outside 'select' clause
76
- none ( )
77
- }
69
+ predicate observeDiffInformedIncrementalMode ( ) { any ( ) }
78
70
}
79
71
80
72
/** Global taint-tracking for detecting "use of a broken or weak cryptographic hashing algorithm on passwords" vulnerabilities. */
Original file line number Diff line number Diff line change @@ -173,10 +173,7 @@ private module UntrustedDataToExternalApiConfig implements DataFlow::ConfigSig {
173
173
predicate isSink ( DataFlow:: Node sink ) { sink instanceof ExternalApiDataNode }
174
174
175
175
predicate observeDiffInformedIncrementalMode ( ) {
176
- // TODO(diff-informed): Manually verify if config can be diff-informed.
177
- // ql/src/Security/CWE-020-ExternalAPIs/ExternalAPIs.qll:181: Flow call outside 'select' clause
178
- // ql/src/Security/CWE-020-ExternalAPIs/ExternalAPIs.qll:184: Flow call outside 'select' clause
179
- none ( )
176
+ none ( ) // Not used for PR analysis
180
177
}
181
178
}
182
179
Original file line number Diff line number Diff line change @@ -112,9 +112,7 @@ module InsecureContextConfiguration implements DataFlow::StateConfigSig {
112
112
}
113
113
114
114
predicate observeDiffInformedIncrementalMode ( ) {
115
- // TODO(diff-informed): Manually verify if config can be diff-informed.
116
- // ql/src/Security/CWE-327/FluentApiModel.qll:130: Flow call outside 'select' clause
117
- none ( )
115
+ none ( ) // Too complicated, but might be possible after some refactoring.
118
116
}
119
117
}
120
118
Original file line number Diff line number Diff line change @@ -40,9 +40,7 @@ module SmtpLib {
40
40
}
41
41
42
42
predicate observeDiffInformedIncrementalMode ( ) {
43
- // TODO(diff-informed): Manually verify if config can be diff-informed.
44
- // ql/src/experimental/semmle/python/libraries/SmtpLib.qll:91: Flow call outside 'select' clause
45
- none ( )
43
+ none ( ) // Used in library model
46
44
}
47
45
}
48
46
You can’t perform that action at this time.
0 commit comments