Headline
GHSA-x33c-7c2v-mrj9: Apollo Router Affected by an Access Control Bypass on Polymorphic Types
Summary
A vulnerability in Apollo Router allowed for unauthenticated queries to access data that required additional access controls. Router incorrectly handled access control directives on interface types/fields and their implementing object types/fields, applying them to interface types/fields while ignoring directives on their implementing object types/fields when all implementations had the same requirements.
Details
Apollo Federation allows users to specify access control directives (@authenticated, @requiresScopes, and @policy) to protect object and interface types and fields. However, the GraphQL specification does not define inheritance rules for directives from interfaces to their implementations. Apollo Router will enforce any directives on the interface types/fields but ignore any directives on the implementation object types/fields (as long as all implementations have the same requirements). This inconsistent enforcement behavior leads to unexpected runtime security gaps.
Who is impacted
This vulnerability impacts Apollo Router customers defining @authenticated, @requiresScopes, or @policy directives inconsistently on polymorphic types (i.e., object types that implement interface types). Specifically, if the same access control directives are applied to all implementing types/fields but not on their implemented interface types/fields, they could be impacted.
Scope of Impact
This vulnerability could allow a malicious actor to craft a query that can bypass access control requirements on the object types/fields by instead querying them via implemented interface types/fields that don’t have the same access control requirements.
Patches
This vulnerability has been fixed at runtime in Apollo Router. You may update Router to one of the following versions:
- 1.61.12+
- 2.8.1+
Workarounds
- If you are not immediately updating Router to a patched version, you should apply any included access control requirements to both the appropriate interface types/fields and their implementations.
- Customers not using Apollo Router access control features (
@authenticated,@requiresScopes, or@policydirectives) or not specifying inconsistent access control requirements on polymorphic types/fields are not affected and do not need to take action.
Summary
A vulnerability in Apollo Router allowed for unauthenticated queries to access data that required additional access controls. Router incorrectly handled access control directives on interface types/fields and their implementing object types/fields, applying them to interface types/fields while ignoring directives on their implementing object types/fields when all implementations had the same requirements.
Details
Apollo Federation allows users to specify access control directives (@authenticated, @requiresScopes, and @policy) to protect object and interface types and fields. However, the GraphQL specification does not define inheritance rules for directives from interfaces to their implementations. Apollo Router will enforce any directives on the interface types/fields but ignore any directives on the implementation object types/fields (as long as all implementations have the same requirements). This inconsistent enforcement behavior leads to unexpected runtime security gaps.
Who is impacted
This vulnerability impacts Apollo Router customers defining @authenticated, @requiresScopes, or @policy directives inconsistently on polymorphic types (i.e., object types that implement interface types). Specifically, if the same access control directives are applied to all implementing types/fields but not on their implemented interface types/fields, they could be impacted.
Scope of Impact
This vulnerability could allow a malicious actor to craft a query that can bypass access control requirements on the object types/fields by instead querying them via implemented interface types/fields that don’t have the same access control requirements.
Patches
This vulnerability has been fixed at runtime in Apollo Router. You may update Router to one of the following versions:
- 1.61.12+
- 2.8.1+
Workarounds
- If you are not immediately updating Router to a patched version, you should apply any included access control requirements to both the appropriate interface types/fields and their implementations.
- Customers not using Apollo Router access control features (@authenticated, @requiresScopes, or @policy directives) or not specifying inconsistent access control requirements on polymorphic types/fields are not affected and do not need to take action.
References
- GHSA-x33c-7c2v-mrj9
- apollographql/router@75ca43e