The vulnerability is an Insecure Direct Object Reference (IDOR) within the craft\services\Elements::parseRefs function, which is exposed through the @parseRefs GraphQL directive. The core issue, as detailed in the vulnerability description, is that parseRefs and its helper method _getRefTokenReplacement resolve element reference tags without validating if the current user has the necessary permissions to view the requested element or its attributes. This allows an attacker to bypass authorization and access sensitive data, such as user emails or content from private entries.
The provided patch does not modify the vulnerable Elements::parseRefs function itself. Instead, it mitigates the vulnerability by altering the craft\services\Gql::_loadGqlDirectives function to make the @parseRefs directive optional and disabled by default for GraphQL schemas. Previously, the ParseRefs directive was loaded unconditionally, making the vulnerability accessible in any GraphQL endpoint. The patch introduces a scope check, requiring administrators to explicitly enable the directive for a schema. While this contains the vulnerability, the underlying flaw in Elements::parseRefs remains. During exploitation on a vulnerable version, a runtime profiler would show calls to craft\services\Elements::parseRefs and craft\services\Elements::_getRefTokenReplacement when a malicious GraphQL query with the @parseRefs directive is processed.