initial commit of actions
This commit is contained in:
commit
949ece5785
44660 changed files with 12034344 additions and 0 deletions
30
github/codeql-action-v1/node_modules/eslint-plugin-github/lib/rules/authenticity-token.js
generated
vendored
Normal file
30
github/codeql-action-v1/node_modules/eslint-plugin-github/lib/rules/authenticity-token.js
generated
vendored
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
module.exports = {
|
||||
meta: {
|
||||
type: 'problem',
|
||||
docs: {
|
||||
description: 'disallow usage of CSRF tokens in JavaScript',
|
||||
url: require('../url')(module)
|
||||
},
|
||||
schema: []
|
||||
},
|
||||
|
||||
create(context) {
|
||||
function checkAuthenticityTokenUsage(node, str) {
|
||||
if (str.includes('authenticity_token')) {
|
||||
context.report({
|
||||
node,
|
||||
message:
|
||||
'Form CSRF tokens (authenticity tokens) should not be created in JavaScript and their values should not be used directly for XHR requests.'
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
Literal(node) {
|
||||
if (typeof node.value === 'string') {
|
||||
checkAuthenticityTokenUsage(node, node.value)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue