@@ -11,40 +11,38 @@ import javascript
11
11
import ZipSlipCustomizations:: ZipSlip
12
12
13
13
// Materialize flow labels
14
- private class ConcretePosixPath extends TaintedPath:: Label:: PosixPath {
14
+ deprecated private class ConcretePosixPath extends TaintedPath:: Label:: PosixPath {
15
15
ConcretePosixPath ( ) { this = this }
16
16
}
17
17
18
- private class ConcreteSplitPath extends TaintedPath:: Label:: SplitPath {
18
+ deprecated private class ConcreteSplitPath extends TaintedPath:: Label:: SplitPath {
19
19
ConcreteSplitPath ( ) { this = this }
20
20
}
21
21
22
22
/** A taint tracking configuration for unsafe archive extraction. */
23
23
module ZipSlipConfig implements DataFlow:: StateConfigSig {
24
- class FlowState = DataFlow :: FlowLabel ;
24
+ class FlowState = TaintedPath :: FlowState ;
25
25
26
- predicate isSource ( DataFlow:: Node source , DataFlow :: FlowLabel label ) {
27
- label = source .( Source ) .getAFlowLabel ( )
26
+ predicate isSource ( DataFlow:: Node source , FlowState state ) {
27
+ state = source .( Source ) .getAFlowState ( )
28
28
}
29
29
30
- predicate isSink ( DataFlow:: Node sink , DataFlow:: FlowLabel label ) {
31
- label = sink .( Sink ) .getAFlowLabel ( )
32
- }
30
+ predicate isSink ( DataFlow:: Node sink , FlowState state ) { state = sink .( Sink ) .getAFlowState ( ) }
33
31
34
32
predicate isBarrier ( DataFlow:: Node node ) {
35
33
node instanceof TaintedPath:: Sanitizer or
36
34
node = DataFlow:: MakeBarrierGuard< TaintedPath:: BarrierGuard > :: getABarrierNode ( )
37
35
}
38
36
39
- predicate isBarrier ( DataFlow:: Node node , DataFlow:: FlowLabel label ) {
40
- node = DataFlow:: MakeLabeledBarrierGuard< TaintedPath:: BarrierGuard > :: getABarrierNode ( label )
37
+ predicate isBarrier ( DataFlow:: Node node , FlowState state ) {
38
+ node =
39
+ DataFlow:: MakeStateBarrierGuard< FlowState , TaintedPath:: BarrierGuard > :: getABarrierNode ( state )
41
40
}
42
41
43
42
predicate isAdditionalFlowStep (
44
- DataFlow:: Node node1 , DataFlow:: FlowLabel state1 , DataFlow:: Node node2 ,
45
- DataFlow:: FlowLabel state2
43
+ DataFlow:: Node node1 , FlowState state1 , DataFlow:: Node node2 , FlowState state2
46
44
) {
47
- TaintedPath:: isAdditionalTaintedPathFlowStep ( node1 , node2 , state1 , state2 )
45
+ TaintedPath:: isAdditionalFlowStep ( node1 , state1 , node2 , state2 )
48
46
}
49
47
}
50
48
@@ -76,6 +74,7 @@ deprecated class Configuration extends DataFlow::Configuration {
76
74
DataFlow:: Node src , DataFlow:: Node dst , DataFlow:: FlowLabel srclabel ,
77
75
DataFlow:: FlowLabel dstlabel
78
76
) {
79
- ZipSlipConfig:: isAdditionalFlowStep ( src , srclabel , dst , dstlabel )
77
+ ZipSlipConfig:: isAdditionalFlowStep ( src , TaintedPath:: Label:: toFlowState ( srclabel ) , dst ,
78
+ TaintedPath:: Label:: toFlowState ( dstlabel ) )
80
79
}
81
80
}
0 commit comments