Skip to content

Commit 92c3939

Browse files
committed
JS: Accept InsecureRandomness alerts
1 parent 0f8e85f commit 92c3939

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

  • javascript/ql/test/query-tests/Security/CWE-338

javascript/ql/test/query-tests/Security/CWE-338/tst.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,12 +87,12 @@ function f17() {
8787
}
8888

8989
function f18() {
90-
var secret = (o.password = Math.random());
90+
var secret = (o.password = Math.random()); // $ Alert
9191
}
9292

9393
(function(){
9494
var crypto = require('crypto');
95-
crypto.createHmac('sha256', Math.random());
95+
crypto.createHmac('sha256', Math.random()); // $ Alert
9696
})();
9797

9898
(function () {
@@ -118,7 +118,7 @@ function uid() {
118118
var my_nice_uid = Math.floor(Math.random() * 4_000_000_000); // $ Alert
119119
var liquid = Math.random();
120120
var UUID = Math.random(); // $ Alert
121-
var MY_UID = Math.random(); // NOK OK
121+
var MY_UID = Math.random(); // $ Alert
122122
}
123123

124124
function buildPass(opts, length) {
@@ -136,4 +136,4 @@ function buildPass(opts, length) {
136136
password += chars[Math.floor(Math.random() * chars.length)]; // $ Alert
137137
}
138138
return password;
139-
}
139+
}

0 commit comments

Comments
 (0)