@@ -21,33 +21,32 @@ deprecated private class ConcreteDocumentUrl extends DocumentUrl {
2121 * A taint-tracking configuration for reasoning about unvalidated URL redirections.
2222 */
2323module ClientSideUrlRedirectConfig implements DataFlow:: StateConfigSig {
24- class FlowState = DataFlow :: FlowLabel ;
24+ class FlowState = TaintedUrlSuffix :: FlowState ;
2525
26- predicate isSource ( DataFlow:: Node source , DataFlow :: FlowLabel state ) {
27- source .( Source ) .getAFlowLabel ( ) = state
26+ predicate isSource ( DataFlow:: Node source , FlowState state ) {
27+ source .( Source ) .getAFlowState ( ) = state
2828 }
2929
30- predicate isSink ( DataFlow:: Node sink , DataFlow :: FlowLabel state ) {
30+ predicate isSink ( DataFlow:: Node sink , FlowState state ) {
3131 sink instanceof Sink and state .isTaint ( )
3232 }
3333
3434 predicate isBarrier ( DataFlow:: Node node ) {
3535 node instanceof Sanitizer or node = HostnameSanitizerGuard:: getABarrierNode ( )
3636 }
3737
38- predicate isBarrier ( DataFlow:: Node node , DataFlow :: FlowLabel state ) {
39- TaintedUrlSuffix:: isBarrier ( node , state )
38+ predicate isBarrier ( DataFlow:: Node node , FlowState state ) {
39+ TaintedUrlSuffix:: isStateBarrier ( node , state )
4040 }
4141
4242 predicate isBarrierOut ( DataFlow:: Node node ) { hostnameSanitizingPrefixEdge ( node , _) }
4343
44- predicate isBarrierOut ( DataFlow:: Node node , DataFlow :: FlowLabel label ) { isSink ( node , label ) }
44+ predicate isBarrierOut ( DataFlow:: Node node , FlowState label ) { isSink ( node , label ) }
4545
4646 predicate isAdditionalFlowStep (
47- DataFlow:: Node node1 , DataFlow:: FlowLabel state1 , DataFlow:: Node node2 ,
48- DataFlow:: FlowLabel state2
47+ DataFlow:: Node node1 , FlowState state1 , DataFlow:: Node node2 , FlowState state2
4948 ) {
50- TaintedUrlSuffix:: step ( node1 , node2 , state1 , state2 )
49+ TaintedUrlSuffix:: isAdditionalFlowStep ( node1 , state1 , node2 , state2 )
5150 or
5251 exists ( HtmlSanitizerCall call |
5352 node1 = call .getInput ( ) and
@@ -85,7 +84,8 @@ deprecated class Configuration extends TaintTracking::Configuration {
8584 DataFlow:: Node node1 , DataFlow:: Node node2 , DataFlow:: FlowLabel state1 ,
8685 DataFlow:: FlowLabel state2
8786 ) {
88- ClientSideUrlRedirectConfig:: isAdditionalFlowStep ( node1 , state1 , node2 , state2 )
87+ ClientSideUrlRedirectConfig:: isAdditionalFlowStep ( node1 , FlowState:: fromFlowLabel ( state1 ) ,
88+ node2 , FlowState:: fromFlowLabel ( state2 ) )
8989 or
9090 // Preserve document.url label in step from `location` to `location.href` or `location.toString()`
9191 state1 instanceof DocumentUrl and
0 commit comments