1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
//! # 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
//!
//! ```rust,no_run
//! use gqlprobe::Scanner;
//!
//! # async fn example() -> anyhow::Result<()> {
//! let scanner = Scanner::new("https://api.example.com/graphql")?;
//! let findings = scanner.scan().await?;
//! for finding in &findings {
//! println!("{}", finding.title());
//! }
//! # Ok(())
//! # }
//! ```
//!
//! ## 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).
pub
pub use scrub_evidence;
/// Re-export commonly used types.
pub use EndpointBaseline;
pub use ScanContext;
pub use ;
pub use SchemaGraph;
/// Prelude module for convenient imports.