Incorrect Permission Checking for GraphQL Subscriptions
GHSA-gggm-66rh-pp98 · CVE-2023-38503
Published · Modified
AI SAST
Find this class of vulnerability in your own code
Corgea's AI-native static analysis detects vulnerabilities like this one across your repositories, ranks them by exploitability, and returns review-ready fixes.
Description
Summary
CWE-200: Exposure of Sensitive Information to an Unauthorized Actor
Access to information you should not have access to when the permissions rely on $CURRENT_USER for filtering.
Details
The permission filters (i.e. user_created IS $CURRENT_USER) are not properly checked when using GraphQL subscription resulting in unauthorized users getting event on their subscription which they should not be receiving according to the permissions.
This can be any collection but out-of-the box the directus_users collection is configured with such a permissions filter allowing you to get updates for other users when changes happen.
An example:
subscription {
directus_users_mutated {
event
data {
id
last_access
last_page
}
}
}
Patches
https://github.com/directus/directus/pull/19155
Workarounds
Disable GraphQL Subscriptions
References
Ready to move
Start Securing
Free, no credit card | First findings in minutes