Skip to content

Commit 94e864e

Browse files
committed
add failing test
1 parent 8502939 commit 94e864e

File tree

2 files changed

+15
-1
lines changed
  • javascript/ql/test/query-tests/Security/CWE-915/PrototypePollutingAssignment/sublib

2 files changed

+15
-1
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
(function () {
2+
function Foobar() {}
3+
4+
Foobar.prototype = {
5+
method: function (obj, path, value) {
6+
obj[path[0]][path[1]] = value; // NOT OK - but not flagged [INCONSISTENCY]
7+
},
8+
};
9+
10+
module.exports.foobar = Foobar;
11+
})();
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
module.exports.set = function (obj, path, value) {
22
obj[path[0]][path[1]] = value; // NOT OK
3-
}
3+
}
4+
5+
var other = require('./other')
6+
exports.foobar = other.foobar;

0 commit comments

Comments
 (0)