File tree Expand file tree Collapse file tree 1 file changed +11
-9
lines changed
java/ql/test/library-tests/pathsanitizer Expand file tree Collapse file tree 1 file changed +11
-9
lines changed Original file line number Diff line number Diff line change @@ -2,18 +2,20 @@ import java
2
2
import semmle.code.java.security.PathSanitizer
3
3
import TestUtilities.InlineFlowTest
4
4
5
- class EnableLegacy extends EnableLegacyConfiguration {
6
- EnableLegacy ( ) { exists ( this ) }
7
- }
5
+ module PathSanitizerConfig implements DataFlow:: ConfigSig {
6
+ predicate isSource ( DataFlow:: Node source ) { DefaultFlowConfig:: isSource ( source ) }
8
7
9
- class PathSanitizerConf extends DefaultTaintFlowConf {
10
- override predicate isSanitizer ( DataFlow:: Node sanitizer ) {
11
- sanitizer instanceof PathInjectionSanitizer
12
- }
8
+ predicate isSink ( DataFlow:: Node sink ) { DefaultFlowConfig:: isSink ( sink ) }
9
+
10
+ predicate isBarrier ( DataFlow:: Node sanitizer ) { sanitizer instanceof PathInjectionSanitizer }
13
11
}
14
12
13
+ module PathSanitizerFlow = TaintTracking:: Global< PathSanitizerConfig > ;
14
+
15
15
class Test extends InlineFlowTest {
16
- override DataFlow:: Configuration getValueFlowConfig ( ) { none ( ) }
16
+ override predicate hasValueFlow ( DataFlow:: Node src , DataFlow :: Node sink ) { none ( ) }
17
17
18
- override DataFlow:: Configuration getTaintFlowConfig ( ) { result = any ( PathSanitizerConf config ) }
18
+ override predicate hasTaintFlow ( DataFlow:: Node src , DataFlow:: Node sink ) {
19
+ PathSanitizerFlow:: flow ( src , sink )
20
+ }
19
21
}
You can’t perform that action at this time.
0 commit comments