Skip to content

Commit d82acf5

Browse files
committed
Java: Add simple type sanitization to java/zipslip.
1 parent 92df0a3 commit d82acf5

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

java/ql/lib/semmle/code/java/security/ZipSlipQuery.qll

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import semmle.code.java.security.PathSanitizer
66
private import semmle.code.java.dataflow.ExternalFlow
77
private import semmle.code.java.dataflow.FlowSources
88
private import semmle.code.java.security.PathCreation
9+
private import semmle.code.java.security.Sanitizers
910

1011
/**
1112
* A method that returns the name of an archive entry.
@@ -39,7 +40,10 @@ module ZipSlipConfig implements DataFlow::ConfigSig {
3940

4041
predicate isSink(DataFlow::Node sink) { sink instanceof FileCreationSink }
4142

42-
predicate isBarrier(DataFlow::Node node) { node instanceof PathInjectionSanitizer }
43+
predicate isBarrier(DataFlow::Node node) {
44+
node instanceof SimpleTypeSanitizer or
45+
node instanceof PathInjectionSanitizer
46+
}
4347
}
4448

4549
/** Tracks flow from archive entries to file creation. */

0 commit comments

Comments
 (0)