Foreword |
|
xv | |
Acknowledgments |
|
xix | |
Introduction |
|
xxi | |
Who This Book Is For |
|
xxii | |
The Book's Lab and Code Repository |
|
xxii | |
What's in This Book |
|
xxii | |
|
|
1 | (20) |
|
|
1 | (2) |
|
|
2 | (1) |
|
|
2 | (1) |
|
|
3 | (1) |
|
How Do Communications Work? |
|
|
3 | (5) |
|
|
4 | (2) |
|
|
6 | (1) |
|
The Query Parser and Resolver Functions |
|
|
7 | (1) |
|
What Problems Does GraphQL Solve? |
|
|
8 | (1) |
|
GraphQL APIs vs. REST APIs |
|
|
9 | (8) |
|
|
10 | (2) |
|
|
12 | (3) |
|
|
15 | (2) |
|
|
17 | (3) |
|
|
20 | (1) |
|
2 Setting Up A Graphql Security Lab |
|
|
21 | (20) |
|
Taking Security Precautions |
|
|
22 | (1) |
|
|
23 | (1) |
|
|
24 | (4) |
|
Querying from the Command Line with cURL |
|
|
25 | (1) |
|
Querying from a GUI with Altair |
|
|
25 | (3) |
|
Setting Up a Vulnerable GraphQL Server |
|
|
28 | (3) |
|
|
28 | (1) |
|
Deploying the Damn Vulnerable GraphQL Application |
|
|
29 | (2) |
|
|
31 | (1) |
|
Installing GraphQL Hacking Tools |
|
|
31 | (9) |
|
|
32 | (1) |
|
|
33 | (1) |
|
|
34 | (1) |
|
|
35 | (1) |
|
|
36 | (1) |
|
|
37 | (1) |
|
|
37 | (1) |
|
|
38 | (1) |
|
|
39 | (1) |
|
|
39 | (1) |
|
|
40 | (1) |
|
|
40 | (1) |
|
3 The Graphql Attack Surface |
|
|
41 | (30) |
|
What Is an Attack Surface? |
|
|
41 | (1) |
|
|
42 | (14) |
|
Queries, Mutations, and Subscriptions |
|
|
43 | (3) |
|
|
46 | (1) |
|
|
47 | (1) |
|
|
48 | (2) |
|
|
50 | (2) |
|
|
52 | (1) |
|
|
53 | (1) |
|
|
54 | (2) |
|
|
56 | (7) |
|
|
57 | (1) |
|
|
58 | (1) |
|
|
58 | (2) |
|
|
60 | (1) |
|
|
61 | (1) |
|
|
62 | (1) |
|
|
63 | (3) |
|
|
66 | (1) |
|
|
67 | (3) |
|
Specification Rule and Implementation Weaknesses |
|
|
67 | (2) |
|
|
69 | (1) |
|
|
69 | (1) |
|
Authentication and Authorization Flaws |
|
|
69 | (1) |
|
|
70 | (1) |
|
|
70 | (1) |
|
|
71 | (30) |
|
|
72 | (9) |
|
|
73 | (1) |
|
|
74 | (2) |
|
|
76 | (2) |
|
|
78 | (2) |
|
|
80 | (1) |
|
Detecting GraphiQL Explorer and GraphQL Playground |
|
|
81 | (6) |
|
Scanning for Graphical Interfaces with EyeWitness |
|
|
82 | (2) |
|
Attempting a Query Using Graphical Clients |
|
|
84 | (3) |
|
Querying GraphQL by Using Introspection |
|
|
87 | (7) |
|
Visualizing Introspection with GraphQL Voyager |
|
|
92 | (1) |
|
Generating Introspection Documentation with SpectaQL |
|
|
93 | (1) |
|
Exploring Disabled Introspection |
|
|
93 | (1) |
|
|
94 | (5) |
|
Detecting Servers with GraphwOOf |
|
|
97 | (1) |
|
|
98 | (1) |
|
|
99 | (2) |
|
|
101 | (38) |
|
|
102 | (1) |
|
|
102 | (11) |
|
Circular Relationships in GraphQL Schemas |
|
|
103 | (2) |
|
How to Identify Circular Relationships |
|
|
105 | (4) |
|
Circular Query Vulnerabilities |
|
|
109 | (1) |
|
Circular Introspection Vulnerabilities |
|
|
110 | (1) |
|
Circular Fragment Vulnerabilities |
|
|
111 | (2) |
|
|
113 | (3) |
|
Understanding How Field Duplication Works |
|
|
113 | (1) |
|
Testing for Field Duplication Vulnerabilities |
|
|
114 | (2) |
|
|
116 | (3) |
|
Abusing Aliases for Denial of Service |
|
|
117 | (1) |
|
Chaining Aliases and Circular Queries |
|
|
118 | (1) |
|
|
119 | (2) |
|
Abusing Directives for Denial of Service |
|
|
119 | (1) |
|
Testing for Directive Overloading |
|
|
120 | (1) |
|
|
121 | (1) |
|
Array-Based Query Batching |
|
|
122 | (5) |
|
Understanding How Array-Based Query Batching Works |
|
|
122 | (1) |
|
Testing for Array-Based Query Batching |
|
|
123 | (1) |
|
Chaining Circular Queries and Array-Based Query Batching |
|
|
124 | (2) |
|
Detecting Query Batching by Using BatchQL |
|
|
126 | (1) |
|
Performing a DoS Audit with GraphQL Cop |
|
|
127 | (1) |
|
Denial-of-Service Defenses in GraphQL |
|
|
128 | (9) |
|
|
128 | (3) |
|
|
131 | (1) |
|
Alias and Array-Based Batching Limits |
|
|
132 | (1) |
|
|
132 | (1) |
|
Limits on the Number of Returned Records |
|
|
133 | (1) |
|
|
133 | (1) |
|
Automatic Persisted Queries |
|
|
134 | (1) |
|
|
135 | (1) |
|
Web Application Firewalls |
|
|
136 | (1) |
|
|
136 | (1) |
|
|
137 | (2) |
|
|
139 | (24) |
|
Identifying Information Disclosure Vectors in GraphQL |
|
|
140 | (1) |
|
Automating Schema Extraction with InQL |
|
|
140 | (2) |
|
Overcoming Disabled Introspection |
|
|
142 | (3) |
|
Detecting Disabled Introspection |
|
|
142 | (1) |
|
Exploiting Non-production Environments |
|
|
142 | (1) |
|
Exploiting the_type Meta-field |
|
|
143 | (2) |
|
|
145 | (4) |
|
Understanding the Edit-Distance Algorithm |
|
|
146 | (1) |
|
Optimizing Field Suggestion Use |
|
|
146 | (2) |
|
Considering Security Developments |
|
|
148 | (1) |
|
|
149 | (1) |
|
Type Stuffing in the_type Meta-field |
|
|
150 | (2) |
|
Automating Field Suggestion and Stuffing Using Clairvoyance |
|
|
152 | (2) |
|
|
154 | (6) |
|
Exploring Excessive Error Messaging |
|
|
156 | (1) |
|
|
157 | (1) |
|
Inferring Information from Stack Traces |
|
|
158 | (2) |
|
Leaking Data by Using GET-Based Queries |
|
|
160 | (1) |
|
|
160 | (3) |
|
7 Authentication And Authorization Bypasses |
|
|
163 | (24) |
|
The State of Authentication and Authorization in GraphQL |
|
|
164 | (7) |
|
|
164 | (1) |
|
|
165 | (6) |
|
|
171 | (9) |
|
Detecting the Authentication Layer |
|
|
172 | (1) |
|
Brute-Forcing Passwords by Using Query Batching |
|
|
173 | (3) |
|
Brute-Forcing Passwords with CrackQL |
|
|
176 | (1) |
|
Using Allow-Listed Operation Names |
|
|
177 | (1) |
|
Forging and Leaking JWT Credentials |
|
|
178 | (2) |
|
|
180 | (5) |
|
Detecting the Authorization Layer |
|
|
181 | (1) |
|
Enumerating Paths with graphql-path-enum |
|
|
182 | (1) |
|
Brute-Forcing Arguments and Fields with CrackQL |
|
|
183 | (2) |
|
|
185 | (2) |
|
|
187 | (34) |
|
Injection Vulnerabilities in GraphQL |
|
|
188 | (2) |
|
The Blast Radius of Malicious Input |
|
|
188 | (1) |
|
|
189 | (1) |
|
|
190 | (5) |
|
|
191 | (2) |
|
|
193 | (1) |
|
Query Directive Arguments |
|
|
193 | (1) |
|
|
194 | (1) |
|
|
195 | (1) |
|
|
196 | (9) |
|
Understanding the Types of SQL Injection |
|
|
196 | (1) |
|
|
197 | (1) |
|
Testing DVGA for SQLi with Burp Suite |
|
|
197 | (6) |
|
|
203 | (2) |
|
Operating System Command Injection |
|
|
205 | (6) |
|
|
206 | (1) |
|
|
207 | (1) |
|
Automated Testing with Commix |
|
|
208 | (2) |
|
Code Review of a Resolver Function |
|
|
210 | (1) |
|
|
211 | (8) |
|
|
211 | (2) |
|
|
213 | (1) |
|
|
214 | (1) |
|
|
214 | (5) |
|
|
219 | (2) |
|
9 Request Forgery And Hijacking |
|
|
221 | (26) |
|
Cross-Site Request Forgery |
|
|
222 | (12) |
|
Locating State-Changing Actions |
|
|
223 | (2) |
|
Testing for POST-Based Vulnerabilities |
|
|
225 | (2) |
|
Automatically Submitting a CSRF Form |
|
|
227 | (1) |
|
Testing for GET-Based Vulnerabilities |
|
|
228 | (2) |
|
|
230 | (2) |
|
Automating Testing with BatchQL and GraphQL Cop |
|
|
232 | (1) |
|
|
232 | (2) |
|
Server-Side Request Forgery |
|
|
234 | (6) |
|
Understanding the Types of SSRF |
|
|
235 | (1) |
|
Searching for Vulnerable Operations, Fields, and Arguments |
|
|
236 | (1) |
|
|
236 | (4) |
|
|
240 | (1) |
|
Cross-Site WebSocket Hijacking |
|
|
240 | (5) |
|
Finding Subscription Operations |
|
|
241 | (1) |
|
Hijacking a Subscription Query |
|
|
241 | (3) |
|
|
244 | (1) |
|
|
245 | (2) |
|
10 Disclosed Vulnerabilities And Exploits |
|
|
247 | (22) |
|
|
248 | (8) |
|
A Large Payload (HackerOne) |
|
|
248 | (1) |
|
Regular Expressions (CS Money) |
|
|
249 | (2) |
|
A Circular Introspection Query (GitLab) |
|
|
251 | (1) |
|
Aliases for Field Duplication (Magento) |
|
|
252 | (1) |
|
Array-Based Batching for Field Duplication (WPGraphQL) |
|
|
253 | (2) |
|
Circular Fragments (Agoo) |
|
|
255 | (1) |
|
|
256 | (5) |
|
Allowing Data Access to Deactivated Users (GitLab) |
|
|
256 | (1) |
|
Allowing an Unprivileged Staff Member to Modify a Customer's Email (Shopify) |
|
|
257 | (1) |
|
Disclosing the Number of Allowed Hackers Through a Team Object (HackerOne) |
|
|
258 | (1) |
|
Reading Private Notes (GitLab) |
|
|
259 | (1) |
|
Disclosing Payment Transaction Information (HackerOne) |
|
|
260 | (1) |
|
|
261 | (1) |
|
Enumerating GraphQL Users (GitLab) |
|
|
261 | (1) |
|
Accessing the Introspection Query via WebSocket (Nuri) |
|
|
262 | (1) |
|
|
262 | (5) |
|
SQL Injection in a GET Query Parameter (HackerOne) |
|
|
262 | (2) |
|
SQL Injection in an Object Argument (Apache SkyWalking) |
|
|
264 | (1) |
|
Cross-Site Scripting (GraphQL Playground) |
|
|
265 | (2) |
|
Cross-Site Request Forgery (GitLab) |
|
|
267 | (1) |
|
|
268 | (1) |
|
A Graphql Api Testing Checklist |
|
|
269 | (4) |
|
|
269 | (1) |
|
|
270 | (1) |
|
|
270 | (1) |
|
Authentication and Authorization |
|
|
270 | (1) |
|
|
271 | (1) |
|
|
271 | (1) |
|
|
271 | (2) |
|
B Graphql Security Resources |
|
|
273 | (2) |
|
Penetration Testing Tips and Tricks |
|
|
273 | (1) |
|
|
274 | (1) |
|
|
274 | (1) |
Index |
|
275 | |