Skip to content

Commit a204209

Browse files
committed
JS: Restrict reachableFromStoreBase
1 parent 9852455 commit a204209

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

javascript/ql/src/semmle/javascript/dataflow/Configuration.qll

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -901,8 +901,14 @@ private predicate reachableFromStoreBase(
901901
string prop, DataFlow::Node rhs, DataFlow::Node nd, DataFlow::Configuration cfg,
902902
PathSummary summary
903903
) {
904-
isRelevant(rhs, cfg) and
905-
storeStep(rhs, nd, prop, cfg, summary)
904+
exists(PathSummary s1, PathSummary s2 |
905+
reachableFromSource(rhs, cfg, s1)
906+
or
907+
reachableFromStoreBase(_, _, rhs, cfg, s1)
908+
|
909+
storeStep(rhs, nd, prop, cfg, s2) and
910+
summary = MkPathSummary(false, s1.hasCall().booleanOr(s2.hasCall()), s2.getStartLabel(), s2.getEndLabel())
911+
)
906912
or
907913
exists(DataFlow::Node mid, PathSummary oldSummary, PathSummary newSummary |
908914
reachableFromStoreBase(prop, rhs, mid, cfg, oldSummary) and

0 commit comments

Comments
 (0)