Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
* @author Gkouziik
*/
'use strict'
const { getDocsUrl } = require('../utils')

module.exports = {
meta: {
type: 'suggestion',
Expand All @@ -12,7 +14,8 @@ module.exports = {
docs: {
description: 'Detect the absence of name option in express session',
category: 'Possible Errors',
recommended: true
recommended: true,
url: getDocsUrl('detect-absence-of-name-option-in-exrpress-session')
},
fixable: null
},
Expand Down
4 changes: 3 additions & 1 deletion lib/rules/detect-buffer-unsafe-allocation.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
*/

'use strict'
const { getDocsUrl } = require('../utils')

module.exports = {
meta: {
Expand All @@ -14,7 +15,8 @@ module.exports = {
docs: {
description: 'Buffer.allocUnsafe(size) is not safe and should not be used',
category: 'Possible Errors',
recommended: false
recommended: false,
url: getDocsUrl('detect-buffer-unsafe-allocation')
},
fixable: 'null'
},
Expand Down
4 changes: 3 additions & 1 deletion lib/rules/detect-child-process.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
*/

'use strict'
const { getDocsUrl } = require('../utils')

module.exports = {
meta: {
Expand All @@ -16,7 +17,8 @@ module.exports = {
docs: {
description: 'detect exec with non Literal argument',
category: 'possible errors',
recommended: true
recommended: true,
url: getDocsUrl('detect-child-process')
},
fixable: null
},
Expand Down
4 changes: 3 additions & 1 deletion lib/rules/detect-crlf.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* @author Gkouziik
*/
'use strict'
const { getDocsUrl } = require('../utils')

module.exports = {
meta: {
Expand All @@ -13,7 +14,8 @@ module.exports = {
docs: {
description: 'detect log forging attack ',
category: 'Possible Errors',
recommended: false
recommended: false,
url: getDocsUrl('detect-crlf')
},
fixable: null
},
Expand Down
4 changes: 3 additions & 1 deletion lib/rules/detect-dangerous-redirects.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
*/

'use strict'
const { getDocsUrl } = require('../utils')

module.exports = {
meta: {
Expand All @@ -14,7 +15,8 @@ module.exports = {
docs: {
description: 'detect dangerous redirects',
category: 'Possible Errors',
recommended: true
recommended: true,
url: getDocsUrl('detect-dangerous-redirects')
},
fixable: null
},
Expand Down
4 changes: 3 additions & 1 deletion lib/rules/detect-eval-with-expr.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* @author Gkouziik
*/
'use strict'
const { getDocsUrl } = require('../utils')

module.exports = {
meta: {
Expand All @@ -13,7 +14,8 @@ module.exports = {
docs: {
description: 'detect eval with string concatenation',
category: 'Possible Errors',
recommended: true
recommended: true,
url: getDocsUrl('detect-eval-with-expr')
},
fixable: null
},
Expand Down
4 changes: 3 additions & 1 deletion lib/rules/detect-html-injection.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
*/

'use strict'
const { getDocsUrl } = require('../utils')

module.exports = {
meta: {
Expand All @@ -14,7 +15,8 @@ module.exports = {
docs: {
description: 'Detect html injection',
category: 'Possible Errors',
recommended: true
recommended: true,
url: getDocsUrl('detect-html-injection')
},
fixable: null
},
Expand Down
4 changes: 3 additions & 1 deletion lib/rules/detect-insecure-randomness.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
*/

'use strict'
const { getDocsUrl } = require('../utils')

module.exports = {
meta: {
Expand All @@ -14,7 +15,8 @@ module.exports = {
docs: {
description: 'detect insecure randomness via Math.random()',
category: 'Possible Errros',
recommended: false
recommended: false,
url: getDocsUrl('detect-insecure-randomness')
},
fixable: null
},
Expand Down
4 changes: 3 additions & 1 deletion lib/rules/detect-non-literal-require-calls.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* @author gkouziik
*/
'use strict'
const { getDocsUrl } = require('../utils')

module.exports = {
meta: {
Expand All @@ -13,7 +14,8 @@ module.exports = {
docs: {
description: 'Non literal require calls may cause an attack',
category: 'Possible Errors',
recommended: true
recommended: true,
url: getDocsUrl('detect-non-literal-require-calls')
},
fixable: null
},
Expand Down
4 changes: 3 additions & 1 deletion lib/rules/detect-nosql-injection.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
*/

'use strict'
const { getDocsUrl } = require('../utils')

module.exports = {
meta: {
Expand All @@ -14,7 +15,8 @@ module.exports = {
docs: {
description: 'detect NOsql injection',
category: 'Possible Errors',
recommended: true
recommended: true,
url: getDocsUrl('detect-nosql-injection')
},
fixable: null

Expand Down
4 changes: 3 additions & 1 deletion lib/rules/detect-option-multiplestatements-in-mysql.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* @author Gkouziik
*/
'use strict'
const { getDocsUrl } = require('../utils')

module.exports = {
meta: {
Expand All @@ -13,7 +14,8 @@ module.exports = {
docs: {
description: 'detect option mulitpleStatements:true in createConnection method of mysql',
category: 'Possible Errors',
recommended: true
recommended: true,
url: getDocsUrl('detect-option-multiplestatements-in-mysql')
},
fixable: null
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* @author Gkouziik
*/
'use strict'
const { getDocsUrl } = require('../utils')

module.exports = {
meta: {
Expand All @@ -13,7 +14,8 @@ module.exports = {
docs: {
description: 'detect option rejectUnauthorized:false in Nodejs https request method',
category: 'possible errors',
recommended: true
recommended: true,
url: getDocsUrl('detect-option-rejectunauthorized-in-nodejs-httpsrequest')
},
fixable: null
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* @author Gkouziik
*/
'use strict'
const { getDocsUrl } = require('../utils')

module.exports = {
meta: {
Expand All @@ -13,7 +14,8 @@ module.exports = {
docs: {
description: 'detect opion:unsafe in serialize method in serialize-javasript npm package',
category: 'Possible errors',
recommended: true
recommended: true,
url: getDocsUrl('detect-option-unsafe-in-serialize-javascript-npm-package')
},
fixable: null
},
Expand Down
4 changes: 3 additions & 1 deletion lib/rules/detect-possible-timing-attacks.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* @author gkouziik
*/
'use strict'
const { getDocsUrl } = require('../utils')

module.exports = {
meta: {
Expand All @@ -14,7 +15,8 @@ module.exports = {
docs: {
description: 'detect possible timing attacks',
category: 'Possible Errors',
recommended: true
recommended: true,
url: getDocsUrl('detect-possible-timing-attacks')
},
fixable: null

Expand Down
4 changes: 3 additions & 1 deletion lib/rules/detect-runinthiscontext-method-in-nodes-vm.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
*/

'use strict'
const { getDocsUrl } = require('../utils')

module.exports = {
meta: {
Expand All @@ -14,7 +15,8 @@ module.exports = {
docs: {
description: 'detect vm.runInThisContext() method in nodes vm with non Literal argument',
category: 'Possible Errors',
recommended: false
recommended: false,
url: getDocsUrl('detect-runinthiscontext-method-in-nodes-vm')
},
fixable: 'null'
},
Expand Down
4 changes: 3 additions & 1 deletion lib/rules/detect-security-missconfiguration-cookie.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
*/

'use strict'
const { getDocsUrl } = require('../utils')

module.exports = {
meta: {
Expand All @@ -14,7 +15,8 @@ module.exports = {
docs: {
description: 'detect security missconfiguration in express cookie',
category: 'Possible Errors',
recommended: true
recommended: true,
url: getDocsUrl('detect-security-missconfiguration-cookie')
},
fixable: null
},
Expand Down
4 changes: 3 additions & 1 deletion lib/rules/detect-sql-injection.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* @author Gkouziik
*/
'use strict'
const { getDocsUrl } = require('../utils')

module.exports = {
meta: {
Expand All @@ -13,7 +14,8 @@ module.exports = {
docs: {
description: 'detect SQL injection',
category: 'Possible Errors',
recommended: false
recommended: false,
url: getDocsUrl('detect-sql-injection')
},
fixable: null
},
Expand Down
4 changes: 3 additions & 1 deletion lib/rules/disable-ssl-across-node-server.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* @author Gkouziik
*/
'use strict'
const { getDocsUrl } = require('../utils')

module.exports = {
meta: {
Expand All @@ -13,7 +14,8 @@ module.exports = {
docs: {
description: "process.env.NODE_TLS_REJECT_UNAUTHORIZED='0' disables SSL across node server!",
category: 'Possible Errors',
recommended: true
recommended: true,
url: getDocsUrl('disable-ssl-across-node-server')
},
fixable: null
},
Expand Down
5 changes: 4 additions & 1 deletion lib/rules/non-literal-reg-expr.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
* @author Gkouziik
*/
'use strict'
const { getDocsUrl } = require('../utils')

module.exports = {
meta: {
type: 'suggestion',
Expand All @@ -12,7 +14,8 @@ module.exports = {
docs: {
description: 'Non literal regural expressions may cause possible attack',
category: 'Possible Errors',
recommended: true
recommended: true,
url: getDocsUrl('non-literal-reg-expr')
},
fixable: null
},
Expand Down
7 changes: 7 additions & 0 deletions lib/utils.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
function getDocsUrl (ruleName) {
return 'https://github.com/gkouziik/eslint-plugin-security-node/blob/master/docs/rules/' + ruleName + '.md'
}

module.exports = {
getDocsUrl
}