# karan2527/gqlx architecture

> Architecture diagram of the GitHub repository karan2527/gqlx, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-20). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/karan2527/gqlx
- Repository: https://github.com/karan2527/gqlx

## Overview

gqlx is a command-line GraphQL security-testing framework. Its primary scan flow accepts target and authentication options, discovers a schema (including fallback discovery), parses it into operations and types, runs selected security modules, scores findings, and writes a report. Separate CLI workflows support deeper enumeration and identity/context discovery, including Cognito/AppSync deployments. The graph preserves the documented vulnerability modules and report formats. Some links rely on README statements or indexed references because their source was not excerpted; those limits are reflected in the evidence paths.

Main entry points: [`gqlx/core/scanner.py`](https://github.com/karan2527/gqlx/blob/main/gqlx/core/scanner.py) (Scan orchestrator), [`gqlx/core/requester.py`](https://github.com/karan2527/gqlx/blob/main/gqlx/core/requester.py) (HTTP requester), [`gqlx/core/introspector.py`](https://github.com/karan2527/gqlx/blob/main/gqlx/core/introspector.py) (Schema introspection), [`gqlx/cli.py`](https://github.com/karan2527/gqlx/blob/main/gqlx/cli.py) (Command line)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_cli["CLI workflows"]
  node_cli["Command line<br/>[cli.py]"]
  node_cognito["Cognito auth<br/>[cognito_auth.py]"]
  node_context["Context discovery"]
end

subgraph group_discovery["Schema discovery"]
  node_introspector["Schema introspection<br/>[introspector.py]"]
  node_parser["Schema parser<br/>[parser.py]"]
  node_enumerator["Operation enumeration<br/>[enumerator.py]"]
end

subgraph group_testing["Security testing"]
  node_scanner["Scan orchestrator<br/>[scanner.py]"]
  node_modulebase["Module framework<br/>[base.py]"]
  node_injection["Injection checks<br/>[injection.py]"]
  node_bola["BOLA checks<br/>[bola.py]"]
  node_auth["Authentication checks<br/>[auth.py]"]
  node_ssrf["SSRF checks<br/>[ssrf.py]"]
  node_tenant["Tenant isolation"]
  node_disclosure["Information disclosure<br/>[info_disclosure.py]"]
  node_dos["DoS protections<br/>[dos.py]"]
end

subgraph group_results["Results and shared runtime"]
  node_requester["HTTP requester<br/>[requester.py]"]
  node_models["Schema and findings<br/>[models.py]"]
  node_scorer["Finding scorer<br/>[scorer.py]"]
  node_reporter["Report writer<br/>[reporter.py]"]
end

node_operator(("Authorized operator"))
node_target["GraphQL endpoint"]

node_operator -->|"configures scan"| node_cli
node_cli -->|"starts scan"| node_scanner
node_scanner -->|"discovers schema"| node_introspector
node_introspector -->|"sends probes"| node_requester
node_introspector -->|"queries schema"| node_target
node_scanner -->|"parses response"| node_parser
node_parser -->|"builds schema"| node_models
node_scanner -->|"resolves modules"| node_modulebase
node_scanner -->|"dispatches"| node_injection
node_scanner -->|"dispatches"| node_bola
node_scanner -->|"dispatches"| node_auth
node_scanner -->|"dispatches"| node_ssrf
node_scanner -->|"dispatches"| node_tenant
node_scanner -->|"dispatches"| node_disclosure
node_scanner -->|"dispatches"| node_dos
node_injection -->|"sends tests"| node_requester
node_auth -->|"compares responses"| node_requester
node_tenant -->|"probes identities"| node_requester
node_requester -->|"sends requests"| node_target
node_scanner -->|"scores findings"| node_scorer
node_scorer -->|"updates findings"| node_models
node_scanner -->|"returns scan result"| node_reporter
node_reporter -->|"writes report"| node_operator
node_operator -->|"requests enumeration"| node_enumerator
node_enumerator -->|"sends operations"| node_requester
node_operator -->|"starts autopwn"| node_context
node_context -->|"probes user context"| node_requester
node_operator -->|"starts fullpwn"| node_cognito
node_cognito -.->|"supports AppSync auth"| node_target

click node_cli "https://github.com/karan2527/gqlx/blob/main/gqlx/cli.py"
click node_cognito "https://github.com/karan2527/gqlx/blob/main/gqlx/core/cognito_auth.py"
click node_context "https://github.com/karan2527/gqlx/blob/main/gqlx/core/context_discoverer.py"
click node_introspector "https://github.com/karan2527/gqlx/blob/main/gqlx/core/introspector.py"
click node_parser "https://github.com/karan2527/gqlx/blob/main/gqlx/core/parser.py"
click node_enumerator "https://github.com/karan2527/gqlx/blob/main/gqlx/core/enumerator.py"
click node_requester "https://github.com/karan2527/gqlx/blob/main/gqlx/core/requester.py"
click node_scanner "https://github.com/karan2527/gqlx/blob/main/gqlx/core/scanner.py"
click node_modulebase "https://github.com/karan2527/gqlx/blob/main/gqlx/modules/base.py"
click node_injection "https://github.com/karan2527/gqlx/blob/main/gqlx/modules/injection.py"
click node_bola "https://github.com/karan2527/gqlx/blob/main/gqlx/modules/bola.py"
click node_auth "https://github.com/karan2527/gqlx/blob/main/gqlx/modules/auth.py"
click node_ssrf "https://github.com/karan2527/gqlx/blob/main/gqlx/modules/ssrf.py"
click node_tenant "https://github.com/karan2527/gqlx/blob/main/gqlx/modules/tenant_isolation.py"
click node_disclosure "https://github.com/karan2527/gqlx/blob/main/gqlx/modules/info_disclosure.py"
click node_dos "https://github.com/karan2527/gqlx/blob/main/gqlx/modules/dos.py"
click node_models "https://github.com/karan2527/gqlx/blob/main/gqlx/utils/models.py"
click node_scorer "https://github.com/karan2527/gqlx/blob/main/gqlx/core/scorer.py"
click node_reporter "https://github.com/karan2527/gqlx/blob/main/gqlx/output/reporter.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_cli,node_cognito,node_context toneBlue
class node_introspector,node_parser,node_enumerator toneAmber
class node_scanner,node_modulebase,node_injection,node_bola,node_auth,node_ssrf,node_tenant,node_disclosure,node_dos toneMint
class node_requester,node_models,node_scorer,node_reporter toneRose
class node_operator,node_target toneIndigo
```

## Components

### CLI workflows

- [Command line](https://github.com/karan2527/gqlx/blob/main/gqlx/cli.py): `gqlx/cli.py`
- [Cognito auth](https://github.com/karan2527/gqlx/blob/main/gqlx/core/cognito_auth.py): `gqlx/core/cognito_auth.py`
- [Context discovery](https://github.com/karan2527/gqlx/blob/main/gqlx/core/context_discoverer.py): `gqlx/core/context_discoverer.py`

### Schema discovery

- [Schema introspection](https://github.com/karan2527/gqlx/blob/main/gqlx/core/introspector.py): `gqlx/core/introspector.py`
- [Schema parser](https://github.com/karan2527/gqlx/blob/main/gqlx/core/parser.py): `gqlx/core/parser.py`
- [Operation enumeration](https://github.com/karan2527/gqlx/blob/main/gqlx/core/enumerator.py): `gqlx/core/enumerator.py`

### Security testing

- [Scan orchestrator](https://github.com/karan2527/gqlx/blob/main/gqlx/core/scanner.py): `gqlx/core/scanner.py`
- [Module framework](https://github.com/karan2527/gqlx/blob/main/gqlx/modules/base.py): `gqlx/modules/base.py`
- [Injection checks](https://github.com/karan2527/gqlx/blob/main/gqlx/modules/injection.py): `gqlx/modules/injection.py`
- [BOLA checks](https://github.com/karan2527/gqlx/blob/main/gqlx/modules/bola.py): `gqlx/modules/bola.py`
- [Authentication checks](https://github.com/karan2527/gqlx/blob/main/gqlx/modules/auth.py): `gqlx/modules/auth.py`
- [SSRF checks](https://github.com/karan2527/gqlx/blob/main/gqlx/modules/ssrf.py): `gqlx/modules/ssrf.py`
- [Tenant isolation](https://github.com/karan2527/gqlx/blob/main/gqlx/modules/tenant_isolation.py): `gqlx/modules/tenant_isolation.py`
- [Information disclosure](https://github.com/karan2527/gqlx/blob/main/gqlx/modules/info_disclosure.py): `gqlx/modules/info_disclosure.py`
- [DoS protections](https://github.com/karan2527/gqlx/blob/main/gqlx/modules/dos.py): `gqlx/modules/dos.py`

### Results and shared runtime

- [HTTP requester](https://github.com/karan2527/gqlx/blob/main/gqlx/core/requester.py): `gqlx/core/requester.py`
- [Schema and findings](https://github.com/karan2527/gqlx/blob/main/gqlx/utils/models.py): `gqlx/utils/models.py`
- [Finding scorer](https://github.com/karan2527/gqlx/blob/main/gqlx/core/scorer.py): `gqlx/core/scorer.py`
- [Report writer](https://github.com/karan2527/gqlx/blob/main/gqlx/output/reporter.py): `gqlx/output/reporter.py`

### Other components

- **Authorized operator**
- **GraphQL endpoint**

## Connections

- Authorized operator → Command line: configures scan (evidence: `README.md`)
- Command line → Scan orchestrator: starts scan (evidence: `gqlx/cli.py`)
- Scan orchestrator → Schema introspection: discovers schema (evidence: `gqlx/core/scanner.py`)
- Schema introspection → HTTP requester: sends probes (evidence: `gqlx/core/introspector.py`)
- Schema introspection → GraphQL endpoint: queries schema (evidence: `README.md`)
- Scan orchestrator → Schema parser: parses response (evidence: `gqlx/core/scanner.py`)
- Schema parser → Schema and findings: builds schema (evidence: `gqlx/core/parser.py`)
- Scan orchestrator → Module framework: resolves modules (evidence: `gqlx/core/scanner.py`)
- Scan orchestrator → Injection checks: dispatches (evidence: `gqlx/core/scanner.py`)
- Scan orchestrator → BOLA checks: dispatches (evidence: `gqlx/core/scanner.py`)
- Scan orchestrator → Authentication checks: dispatches (evidence: `gqlx/core/scanner.py`)
- Scan orchestrator → SSRF checks: dispatches (evidence: `gqlx/core/scanner.py`)
- Scan orchestrator → Tenant isolation: dispatches (evidence: `gqlx/core/scanner.py`)
- Scan orchestrator → Information disclosure: dispatches (evidence: `gqlx/core/scanner.py`)
- Scan orchestrator → DoS protections: dispatches (evidence: `gqlx/core/scanner.py`)
- Injection checks → HTTP requester: sends tests (evidence: `gqlx/modules/injection.py`)
- Authentication checks → HTTP requester: compares responses (evidence: `gqlx/modules/auth.py`)
- Tenant isolation → HTTP requester: probes identities (evidence: `gqlx/modules/tenant_isolation.py`)
- HTTP requester → GraphQL endpoint: sends requests (evidence: `gqlx/core/requester.py`)
- Scan orchestrator → Finding scorer: scores findings (evidence: `gqlx/core/scanner.py`)
- Finding scorer → Schema and findings: updates findings (evidence: `gqlx/core/scorer.py`)
- Scan orchestrator → Report writer: returns scan result (evidence: `gqlx/cli.py`)
- Report writer → Authorized operator: writes report (evidence: `README.md`)
- Authorized operator → Operation enumeration: requests enumeration (evidence: `README.md`)
- Operation enumeration → HTTP requester: sends operations (evidence: `gqlx/core/enumerator.py`)
- Authorized operator → Context discovery: starts autopwn (evidence: `README.md`)
- Context discovery → HTTP requester: probes user context (evidence: `gqlx/core/context_discoverer.py`)
- Authorized operator → Cognito auth: starts fullpwn (evidence: `README.md`)
- Cognito auth → GraphQL endpoint: supports AppSync auth (evidence: `README.md`)
