Exploring A01: Broken Access Control – GraphQL Introspection Misconfiguration

 While working on A01: Broken Access Control from the OWASP Top 10, I came across an interesting security misconfiguration involving GraphQL introspection.

Objective:

Through using the GraphQL introspection feature, discover the user that has the “isAdmin” privileges.

Background

By default, GraphQL does not provide built-in authentication or authorization. This means developers must manually implement proper access controls. If not done correctly, attackers can perform unrestricted queries and access sensitive data.

Reconnaissance 

Upon visiting the application URL, I found several posts published by two users — this gave me a hint that user data was accessible through GraphQL queries.

 

Exploitation 

To better understand the backend structure, I used the GraphiQL interface to explore available queries.
Accessing the endpoint:



 i queried  the generic __schema using 


The application gives us interesting Types. Let's explore the User Object one. If we build a more complex query we can ask for more information, exploring every field available. Let's send the following:



We can see that there is an interesting field isAdmin, that we can use to find out who is the admin of the application.

Now we just need to query all the Users. To do that, let's see if there is a query available. We can use the following syntax:


That will give us the allUsers query. Now we need to understand what are the fields. We can do that in different ways, using GraphiQL or doing some more introspection. In this case we use GraphiQL, sending the following query


Finally we found a user that's the admin which is the scope of the lab.

Conclusion

This exercise highlights how improper GraphQL configuration can expose sensitive application data.
Disabling introspection in production and implementing strict authentication and authorization checks are essential to prevent data leaks through GraphQL endpoints.

๐Ÿ”’ Key Takeaways

  • Always disable introspection in production.

  • Implement authentication and authorization for all queries.

  • Use schema whitelisting to limit exposed fields.

  • Regularly perform security testing on APIs.



t
o
se
n
d
q
u
e
r
i
e
s
t
o
t
h
e
b
a
cke
n
d
a
n
d
d
i
sco
ve
r
w
h
a
t
i
s
a
va
i
l
a
b
l
e
.
G
o
t
o
h
t
t
p
:
/
/
0
.
0
.
0
.
0
:
5
0
0
0
/
g
r
a
p
h
q
l
.
W
e
ca
n
q
u
e
r
y
t
h
e
g
e
n
e
r
i
c
_
_
s
c
h
e
m
a
u
si
n
g
:

Comments

Popular posts from this blog

Using Hydra to Brute-Force SSH And WI-Fi Login Portal

Discover AWS Organization ID Via S3 Bucket

SMB Relay Attack in AD Lab (Step-by-Step)