Skip to content

Commit 0cdda87

Browse files
committed
JS: Restrict AP length in prototype-polluting function
1 parent 7ccb476 commit 0cdda87

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

javascript/ql/src/Security/CWE-915/PrototypePollutingFunction.ql

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,12 @@ module PropNameTrackingConfig implements DataFlow::StateConfigSig {
277277
node instanceof DataFlow::VarAccessBarrier or
278278
node = DataFlow::MakeBarrierGuard<BarrierGuard>::getABarrierNode()
279279
}
280+
281+
int accessPathLimit() {
282+
// Speed up the query. For the pattern we're looking for the value rarely
283+
// flows through any contents, apart from a capture content.
284+
result = 1
285+
}
280286
}
281287

282288
class FlowState = PropNameTrackingConfig::FlowState;

0 commit comments

Comments
 (0)