mozilla / scanjs

[DEPRECATED] Static analysis tool for javascript code.
Other
428 stars 39 forks source link

[testing][false negative] - var b = "alert"; window[b](1); #82

Closed pwnetrationguru closed 2 years ago

pwnetrationguru commented 10 years ago

Using the example var b = "alert"; window[b](1), ScanJS should catch this pattern if it is looking for alert but currently it does not.

Current failures:

var a = "indexedDB"; window[a].open(3);
var a = "localStorage"; window[a].setItem("name", "user1");
var a = "setInterval"; window[a]("console.log(5)", 300);
var a = "setTimeout"; window[a]("console.log(5)", 300);
window["navigator"]["getDeviceStorage"](storageName);

We whould be able to detect this pattern, so we don't miss dangerous uses.