Skip to main content

Crate gqlprobe

Crate gqlprobe 

Source
Expand description

§gqlprobe

GraphQL security scanner - detect introspection, query depth DoS, batching abuse, field suggestion enumeration, directive abuse, injection vulnerabilities, CSRF, subscription abuse, information disclosure, and authentication bypass.

§Quick Start

use gqlprobe::Scanner;

let scanner = Scanner::new("https://api.example.com/graphql")?;
let findings = scanner.scan().await?;
for finding in &findings {
    println!("{}", finding.title());
}

§Safe defaults

gqlprobe ships with conservative defaults designed to avoid accidentally overwhelming targets or leaking data:

  • Input size: No hardcoded response-body cap in gqlprobe itself. serde_json enforces its own recursion limit (~128 levels); deeply nested payloads beyond that fall back to the iterative compute_depth_nonrecursive parser, which reads the body character by character without allocating the full parse tree. Request bodies sent by gqlprobe are small, bounded GraphQL queries generated internally.
  • Recursion depth: All JSON depth calculations use an explicit stack (max_depth) or a character-scan loop (compute_depth_nonrecursive). There is no recursive descent that could overflow the call stack on adversarial input.
  • Outbound network: Connections are made exclusively to the single target URL supplied by the caller. No callbacks, no second-party lookups, no DNS rebinding. TLS certificate verification is enabled by default; pass --insecure / http_config.accept_invalid_certs only for lab use.
  • Process spawning: None. The std::process import in main.rs is used solely for process::exit(); no Command::new() or shell execution occurs anywhere in the codebase.
  • Filesystem writes: None. All output (human / JSON / JSONL / SARIF) is written to stdout. No temporary files, no log files, no on-disk state.
  • Credential exposure: The scrub_evidence utility redacts lines containing Authorization:, Bearer , token:, api-key:, password:, or secret:, and masks email addresses, before they are embedded in finding evidence strings.

Use ScannerBuilder or CLI flags to override the scan-timing defaults (global timeout 300 s, module timeout 60 s, max concurrency 5).

Re-exports§

pub use baseline::EndpointBaseline;
pub use context::ScanContext;
pub use scanner::ScanConfig;
pub use scanner::Scanner;
pub use scanner::ScannerBuilder;
pub use schema::SchemaGraph;

Modules§

baseline
Endpoint baseline calibration to reduce false positives.
cli
CLI layer for the gqlprobe binary.
context
Shared scan context passed to every detection module.
modules
Attack detection modules for GraphQL security scanning.
parsers
Response parsers for GraphQL security scanning.
prelude
Prelude module for convenient imports.
scanner
Scanner orchestrator for GraphQL security testing.
schema
GraphQL schema discovery and permission metadata from introspection.