@@ -582,49 +582,6 @@ module TaintTracking {
582582 }
583583 }
584584
585- /**
586- * A taint propagating data flow edge for assignments of the form `c1.state.p = v`,
587- * where `c1` is an instance of React component `C`; in this case, we consider
588- * taint to flow from `v` to any read of `c2.state.p`, where `c2`
589- * also is an instance of `C`.
590- */
591- private class ReactComponentStateTaintStep extends SharedTaintStep {
592- override predicate viewComponentStep ( DataFlow:: Node pred , DataFlow:: Node succ ) {
593- exists ( ReactComponent c , DataFlow:: PropRead prn , DataFlow:: PropWrite pwn |
594- (
595- c .getACandidateStateSource ( ) .flowsTo ( pwn .getBase ( ) ) or
596- c .getADirectStateAccess ( ) .flowsTo ( pwn .getBase ( ) )
597- ) and
598- (
599- c .getAPreviousStateSource ( ) .flowsTo ( prn .getBase ( ) ) or
600- c .getADirectStateAccess ( ) .flowsTo ( prn .getBase ( ) )
601- )
602- |
603- prn .getPropertyName ( ) = pwn .getPropertyName ( ) and
604- succ = prn and
605- pred = pwn .getRhs ( )
606- )
607- }
608- }
609-
610- /**
611- * A taint propagating data flow edge for assignments of the form `c1.props.p = v`,
612- * where `c1` is an instance of React component `C`; in this case, we consider
613- * taint to flow from `v` to any read of `c2.props.p`, where `c2`
614- * also is an instance of `C`.
615- */
616- private class ReactComponentPropsTaintStep extends SharedTaintStep {
617- override predicate viewComponentStep ( DataFlow:: Node pred , DataFlow:: Node succ ) {
618- exists ( ReactComponent c , string name , DataFlow:: PropRead prn |
619- prn = c .getAPropRead ( name ) or
620- prn = c .getAPreviousPropsSource ( ) .getAPropertyRead ( name )
621- |
622- pred = c .getACandidatePropsValue ( name ) and
623- succ = prn
624- )
625- }
626- }
627-
628585 /**
629586 * A taint propagating data flow edge arising from string concatenations.
630587 *
0 commit comments