Skip to content
Access control Write-up Intermediate

How to Exploit a Hidden GraphQL Endpoint by Changing POST to GET Request — GraphQL API Labs

A hidden GraphQL endpoint was accessible via GET requests and allowed introspection bypass, enabling an attacker to query user data and execute a mutation to delete a user without proper authorization.

Bash Overflow Follow

Published on infosecwriteups.com

GraphQL has become an essential technology for modern web applications, allowing developers to query APIs with flexibility. However, misconfigurations and security oversights can lead to critical vulnerabilities.

Bash Overflow, on infosecwriteups.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the GraphQL endpoint was not properly protected, allowing introspection and mutations without authentication or authorization checks.

What the attacker needed

Access to the web application; Knowledge of common GraphQL paths

The fix

GraphQL queries and mutations should be restricted based on user roles and permissions, and introspection should be disabled or limited.

How it was found

  1. Brute-force common GraphQL paths to find the endpoint at /api.
  2. Send a GET request to /api with a query parameter to test introspection.
  3. Bypass introspection restriction by adding a new line after __schema.
  4. Save GraphQL queries to Site Map and locate user query and mutation requests.
  5. Query user information to find that carlos has id=3.
  6. Modify the mutation request to delete user with id=3 and send it.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

GraphQL is a way for apps to ask a server for specific data. Here, the server had a hidden GraphQL address that could be reached with a simple web request, and it let anyone list all the available data operations. That meant someone could find and run a command to delete another user.

What is Access control?

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.

More by Bash Overflow

View all

35 more disclosed reports, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Broken access control

The lesson behind this report.

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.