1414import java
1515import semmle.code.java.dataflow.FlowSources
1616import experimental.semmle.code.java.security.FileAndFormRemoteSource
17- import experimental.semmle.code.java.security.DecompressionBomb
17+ import experimental.semmle.code.java.security.DecompressionBomb:: DecompressionBomb
1818
1919module DecompressionBombsConfig implements DataFlow:: StateConfigSig {
20- class FlowState = DataFlow :: FlowState ;
20+ class FlowState = DecompressionState ;
2121
2222 predicate isSource ( DataFlow:: Node source , FlowState state ) {
2323 (
@@ -27,17 +27,27 @@ module DecompressionBombsConfig implements DataFlow::StateConfigSig {
2727 or
2828 source instanceof FileUploadRemoteFlowSource
2929 ) and
30- state = [ "ZipFile" , "Zip4j" , "inflator" , "UtilZip" , "ApacheCommons" , "XerialSnappy" ]
30+ (
31+ state instanceof ZipFile
32+ or
33+ state instanceof Zip4j
34+ or
35+ state instanceof Inflator
36+ or
37+ state instanceof ApacheCommons
38+ or
39+ state instanceof XerialSnappy
40+ or
41+ state instanceof UtilZip
42+ )
3143 }
3244
33- predicate isSink ( DataFlow:: Node sink , FlowState state ) {
34- any ( DecompressionBomb:: Sink s ) .sink ( sink , state )
35- }
45+ predicate isSink ( DataFlow:: Node sink , FlowState state ) { any ( Sink s ) .sink ( sink , state ) }
3646
3747 predicate isAdditionalFlowStep (
3848 DataFlow:: Node nodeFrom , FlowState stateFrom , DataFlow:: Node nodeTo , FlowState stateTo
3949 ) {
40- any ( DecompressionBomb :: AdditionalStep ads ) .step ( nodeFrom , stateFrom , nodeTo , stateTo )
50+ any ( AdditionalStep ads ) .step ( nodeFrom , stateFrom , nodeTo , stateTo )
4151 }
4252
4353 predicate isBarrier ( DataFlow:: Node sanitizer , FlowState state ) { none ( ) }
0 commit comments