@@ -16,16 +16,16 @@ deprecated class Configration = Configuration;
1616 * A taint-tracking configuration for reasoning about unsafe HTML constructed from library input vulnerabilities.
1717 */
1818module UnsafeHtmlConstructionConfig implements DataFlow:: StateConfigSig {
19- class FlowState = DataFlow :: FlowLabel ;
19+ import semmle.javascript.security.CommonFlowState
2020
21- predicate isSource ( DataFlow:: Node source , DataFlow :: FlowLabel label ) {
21+ predicate isSource ( DataFlow:: Node source , FlowState state ) {
2222 source instanceof Source and
23- label = [ TaintedObject :: label ( ) , DataFlow :: FlowLabel :: taint ( ) , DataFlow :: FlowLabel :: data ( ) ]
23+ state = [ FlowState :: taintedObject ( ) , FlowState :: taint ( ) ]
2424 }
2525
26- predicate isSink ( DataFlow:: Node sink , DataFlow :: FlowLabel label ) {
26+ predicate isSink ( DataFlow:: Node sink , FlowState state ) {
2727 sink instanceof Sink and
28- label = DataFlow :: FlowLabel :: taint ( )
28+ state = FlowState :: taint ( )
2929 }
3030
3131 predicate isBarrier ( DataFlow:: Node node ) {
@@ -38,27 +38,27 @@ module UnsafeHtmlConstructionConfig implements DataFlow::StateConfigSig {
3838 node = Shared:: BarrierGuard:: getABarrierNode ( )
3939 }
4040
41- predicate isBarrier ( DataFlow:: Node node , DataFlow :: FlowLabel label ) {
42- TaintTracking:: defaultSanitizer ( node ) and label .isTaint ( )
41+ predicate isBarrier ( DataFlow:: Node node , FlowState state ) {
42+ TaintTracking:: defaultSanitizer ( node ) and state .isTaint ( )
4343 or
44- node = DataFlow:: MakeLabeledBarrierGuard < BarrierGuard > :: getABarrierNode ( label )
44+ node = DataFlow:: MakeStateBarrierGuard < FlowState , BarrierGuard > :: getABarrierNode ( state )
4545 }
4646
4747 predicate isAdditionalFlowStep (
48- DataFlow:: Node pred , DataFlow :: FlowLabel inlbl , DataFlow:: Node succ , DataFlow :: FlowLabel outlbl
48+ DataFlow:: Node pred , FlowState inlbl , DataFlow:: Node succ , FlowState outlbl
4949 ) {
5050 // TODO: localFieldStep is too expensive with dataflow2
5151 // DataFlow::localFieldStep(pred, succ) and
5252 // inlbl.isTaint() and
5353 // outlbl.isTaint()
5454 none ( )
5555 or
56- TaintedObject:: step ( pred , succ , inlbl , outlbl )
56+ TaintedObject:: isAdditionalFlowStep ( pred , inlbl , succ , outlbl )
5757 or
5858 // property read from a tainted object is considered tainted
5959 succ .( DataFlow:: PropRead ) .getBase ( ) = pred and
60- inlbl = TaintedObject :: label ( ) and
61- outlbl = DataFlow :: FlowLabel :: taint ( )
60+ inlbl . isTaintedObject ( ) and
61+ outlbl . isTaint ( )
6262 or
6363 TaintTracking:: defaultTaintStep ( pred , succ ) and
6464 inlbl .isTaint ( ) and
0 commit comments