Java: Add simple type sanitization to java/zipslip.

This commit is contained in:
Anders Schack-Mulligen
2024-05-21 11:31:49 +02:00
parent 92df0a3d46
commit d82acf5866

View File

@@ -6,6 +6,7 @@ import semmle.code.java.security.PathSanitizer
private import semmle.code.java.dataflow.ExternalFlow
private import semmle.code.java.dataflow.FlowSources
private import semmle.code.java.security.PathCreation
private import semmle.code.java.security.Sanitizers
/**
* A method that returns the name of an archive entry.
@@ -39,7 +40,10 @@ module ZipSlipConfig implements DataFlow::ConfigSig {
predicate isSink(DataFlow::Node sink) { sink instanceof FileCreationSink }
predicate isBarrier(DataFlow::Node node) { node instanceof PathInjectionSanitizer }
predicate isBarrier(DataFlow::Node node) {
node instanceof SimpleTypeSanitizer or
node instanceof PathInjectionSanitizer
}
}
/** Tracks flow from archive entries to file creation. */