@@ -62,10 +62,27 @@ module UnsafeJQueryPlugin {
6262 * With this taint-step we regain that `foo.bar` is tainted, because `PropertyPresenceSanitizer` could remove it.
6363 */
6464 private predicate aliasPropertyPresenceStep ( DataFlow:: Node src , DataFlow:: Node sink ) {
65- exists ( PropertyPresenceSanitizer sanitizer , DataFlow:: PropRead read | read = src |
66- read = sanitizer .getPropRead ( ) and
67- sink = AccessPath:: getAnAliasedSourceNode ( read ) and
68- read .getBasicBlock ( ) .( ReachableBasicBlock ) .strictlyDominates ( sink .getBasicBlock ( ) )
65+ exists ( ReachableBasicBlock srcBB , ReachableBasicBlock sinkBB |
66+ aliasPropertyPresenceStepHelper ( src , sink , srcBB , sinkBB ) and
67+ srcBB .strictlyDominates ( sinkBB )
68+ )
69+ }
70+
71+ /**
72+ * Holds if there is a taint-step from `src` to `sink`, and `srcBB` is the basicblock for `src` and `sinkBB` is the basicblock for `sink`.
73+ *
74+ * This predicate is outlined to get a better join-order.
75+ */
76+ pragma [ noinline]
77+ private predicate aliasPropertyPresenceStepHelper (
78+ DataFlow:: PropRead src , DataFlow:: Node sink , ReachableBasicBlock srcBB ,
79+ ReachableBasicBlock sinkBB
80+ ) {
81+ exists ( PropertyPresenceSanitizer sanitizer |
82+ src = sanitizer .getPropRead ( ) and
83+ sink = AccessPath:: getAnAliasedSourceNode ( src ) and
84+ srcBB = src .getBasicBlock ( ) and
85+ sinkBB = sink .getBasicBlock ( )
6986 )
7087 }
7188}
0 commit comments