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
22import semmle.code.java.security.PathSanitizer
33import TestUtilities.InlineFlowTest
44
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 ) }
87
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 }
1311}
1412
13+ module PathSanitizerFlow = TaintTracking:: Global< PathSanitizerConfig > ;
14+
1515class Test extends InlineFlowTest {
16- override DataFlow:: Configuration getValueFlowConfig ( ) { none ( ) }
16+ override predicate hasValueFlow ( DataFlow:: Node src , DataFlow :: Node sink ) { none ( ) }
1717
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+ }
1921}
You can’t perform that action at this time.
0 commit comments