Skip to content

Commit ac2f0a8

Browse files
asger-semmleasgerf
authored andcommitted
JS: Do not require flow from key -> rhs
1 parent 96bf9db commit ac2f0a8

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

javascript/ql/src/Security/CWE-400/PrototypePollutionUtility.ql

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -161,12 +161,12 @@ class UnsafePropLabel extends FlowLabel {
161161
* }
162162
* ```
163163
*
164-
* This configuration is used to find four separate data flow paths originating
164+
* This configuration is used to find three separate data flow paths originating
165165
* from a property enumeration, all leading to the same dynamic property write.
166166
*
167-
* In particular, the base, property name, and rhs of the property write should all
167+
* In particular, the base and property name of the property write should all
168168
* depend on the enumerated property name (`key`) and the right-hand side should
169-
* additionally depend on the source object (`src`), while allowing steps of form
169+
* depend on the source property (`src[key]`), while allowing steps of form
170170
* `x -> x[p]` and `p -> x[p]`.
171171
*
172172
* Note that in the above example, the flow from `key` to the base of the write (`dst`)
@@ -384,7 +384,6 @@ predicate isPrototypePollutingAssignment(Node base, Node prop, Node rhs, Enumera
384384
exists(PropNameTracking cfg |
385385
cfg.hasFlow(enum, base) and
386386
cfg.hasFlow(enum, prop) and
387-
cfg.hasFlow(enum, rhs) and
388387
cfg.hasFlow(enum.getASourceProp(), rhs)
389388
)
390389
}

0 commit comments

Comments
 (0)