GraphQL CSRF / GET method
ID: graphql-get-method
Severity: info
Author: Dolev Farhi
Tags: graphql,misconfig
Description
Section titled “Description”Cross Site Request Forgery happens when an external website gains ability to make API calls impersonating an user if he visits the website while being authenticated to your API.Allowing API calls through GET requests can lead to CSRF attacks, because cookies are added automatically to GET requests by the browser.
YAML Source
Section titled “YAML Source”id: graphql-get-method
info: name: GraphQL CSRF / GET method author: Dolev Farhi severity: info description: | Cross Site Request Forgery happens when an external website gains ability to make API calls impersonating an user if he visits the website while being authenticated to your API. Allowing API calls through GET requests can lead to CSRF attacks, because cookies are added automatically to GET requests by the browser. reference: - https://graphql.org/learn/serving-over-http/#get-request - https://github.com/dolevf/Damn-Vulnerable-GraphQL-Application - https://cheatsheetseries.owasp.org/cheatsheets/GraphQL_Cheat_Sheet.html - https://graphql.security/ metadata: max-request: 2 tags: graphql,misconfig
http: - method: GET path: - "{{BaseURL}}/graphql?query={__typename}" - "{{BaseURL}}/api/graphql?query={__typename}"
stop-at-first-match: true
matchers-condition: and matchers: - type: word part: body words: - '"query"' - '"data"' - '"__typename"' case-insensitive: true condition: and
- type: word part: header words: - "application/json"# digest: 4a0a004730450220732f0825a10fe1164e0c6437f367c90719667a9abb3cc4d158f8e04e26d8a3530221008d227947bd767557dbcd326331273cd63315acd956e8218b9dd1ddb9da04d647:922c64590222798bb761d5b6d8e72950Guide to check the vulnerabilities
Section titled “Guide to check the vulnerabilities”This template is used to detect vulnerabilities in web applications. It can be used with the Nuclei tool to scan for specific patterns or behaviors.
$ nuclei -u "URL" -t "http/misconfiguration/graphql/graphql-get-method.yaml"