Skip to content

Commit

Permalink
Merge pull request #42 from trailofbits/apollo-csrf-update
Browse files Browse the repository at this point in the history
Update v4-csrf-prevention rule and add autofix
  • Loading branch information
Vasco-jofra authored Jan 16, 2024
2 parents 04b8335 + f364d8d commit 90561e1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion javascript/apollo-graphql/v4-csrf-prevention.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// OK: Lacks 'csrfPrevention: true', but on v4 this option is false by default
// OK: Lacks 'csrfPrevention: true', but on v4 this option is true by default
//ok: v4-csrf-prevention
const apollo_server_1 = new ApolloServer({
typeDefs,
Expand Down
3 changes: 3 additions & 0 deletions javascript/apollo-graphql/v4-csrf-prevention.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ rules:
description: "CSRF protection disabled"
references:
- https://www.apollographql.com/docs/apollo-server/v3/security/cors/#preventing-cross-site-request-forgery-csrf
fix-regex:
regex: 'csrfPrevention:\s*false'
replacement: "csrfPrevention: true"

patterns:
- pattern: |
Expand Down

0 comments on commit 90561e1

Please sign in to comment.