eslint-plugin-security-node
Version:
Create a security plugin for node.js
38 lines (33 loc) • 669 B
JavaScript
/**
* @fileoverview detect NOsql injection
* @author Gkouziik
*/
const { getDocsUrl } = require('../utils')
module.exports = {
meta: {
type: 'suggestion',
messages: {
msg: 'detect $where'
},
docs: {
description: 'detect NOsql injection',
category: 'Possible Errors',
recommended: true,
url: getDocsUrl('detect-nosql-injection')
},
fixable: null
},
create: function (context) {
return {
'Identifier': function (node) {
if (node.name === '$where') {
context.report({
node: node,
messageId: 'msg'
})
}
}
}
}
}