CVE-2025-64530
Executive Summary
CVE-2025-64530 is a high-severity vulnerability in Apollo Federation's composition logic that allows attackers to bypass access controls on GraphQL types and fields. The flaw arises because user-defined access control directives (such as @authenticated, @requiresScopes, or @policy) placed on interface types and fields are not properly enforced when queries target the implementing object types or fields via inline fragments. This enables unauthorized access to sensitive data.
The vulnerability affects Apollo Federation versions prior to 2.9.5, 2.10.4, 2.11.5, and 2.12.1. The fix in these patched versions disallows user-defined access control directives on interface types and fields entirely, forcing developers to apply such directives directly on implementing object types and fields.
This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.
No signup required
Supply Chain & Package Security
This vulnerability is specific to the Apollo Federation ecosystem, which is a JavaScript/TypeScript-based GraphQL architecture. The affected component is the composition logic used by Apollo Router and Apollo Studio build pipeline. Users of Apollo Rover or Apollo Studio with Federation version 2.8 or below are particularly at risk. The supply chain risk is moderate, as the vulnerability is in the composition logic that generates the supergraph schema, not in runtime code. However, any organization using Apollo Federation with access control directives on interfaces is affected.
CVSS Breakdown & Threat Level
- CVSS Score: 7.5 (High)
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
- Attack Vector: Network
- Attack Complexity: Low
- Privileges Required: None
- User Interaction: None
- Scope: Unchanged
- Confidentiality Impact: High
- Integrity Impact: None
- Availability Impact: None
Threat Level: High. The vulnerability is easily exploitable remotely without authentication, and it can lead to unauthorized access to sensitive data.
Deep Dive & Mechanics
Apollo Federation allows composing multiple GraphQL services into a single unified graph. Access control directives like @authenticated, @requiresScopes, and @policy can be applied to types and fields to restrict access. The vulnerability lies in the composition logic that generates the supergraph schema.
When a user-defined access control directive is placed on an interface type or field, the composition logic should propagate that directive to all implementing object types and fields. However, due to a flaw in the composition logic, this propagation does not occur correctly. An attacker can craft a query that uses inline fragments to target the implementing object types or fields directly, bypassing the access control directives that were only applied to the interface.
For example, consider an interface Node with a field secretData that has an @authenticated directive. An implementing type User also has the field secretData. In the vulnerable version, the composition logic does not automatically apply the @authenticated directive to User.secretData. An attacker can query User.secretData directly without authentication, bypassing the intended access control.
The fix in patched versions disallows user-defined access control directives on interface types and fields entirely. This forces developers to apply such directives directly on each implementing object type and field, ensuring that access control is enforced at the correct level.
Vulnerable vs. Patched Code
Vulnerable Code (Pre-2.9.5, 2.10.4, 2.11.5, 2.12.1):
In the composition logic, when processing interface types and fields with access control directives, the code does not propagate these directives to implementing object types and fields.
// Vulnerable composition logic (simplified)
function composeInterfaceField(interfaceField) {
// Access control directives are stored on the interface field
const directives = interfaceField.directives;
// But they are NOT copied to implementing object fields
return {
name: interfaceField.name,
type: interfaceField.type,
directives: directives // Only on interface
};
}
Patched Code (2.9.5, 2.10.4, 2.11.5, 2.12.1):
The patched composition logic disallows user-defined access control directives on interface types and fields entirely. If such directives are found, an error is raised.
// Patched composition logic (simplified)
function composeInterfaceField(interfaceField) {
// Check for user-defined access control directives
const forbiddenDirectives = ['authenticated', 'requiresScopes', 'policy'];
for (const directive of interfaceField.directives) {
if (forbiddenDirectives.includes(directive.name)) {
throw new Error(`Access control directive @${directive.name} is not allowed on interface fields. Apply it to implementing object fields instead.`);
}
}
return {
name: interfaceField.name,
type: interfaceField.type,
directives: [] // No access control directives on interface
};
}
Exploitation & Lab Setup
Red Team
Objective: Bypass access controls on a GraphQL endpoint using Apollo Federation.
Setup:
- Deploy an Apollo Federation setup with a vulnerable version (e.g., 2.9.4).
- Define an interface
Nodewith a fieldsecretDatathat has an@authenticateddirective. - Define an implementing type
Userwith the fieldsecretData(without the directive). - Expose the GraphQL endpoint via Apollo Router.
Exploitation Steps:
- Craft a GraphQL query that uses an inline fragment to target the implementing type directly:
query { users { ... on User { secretData } } } - Send the query without any authentication token.
- Observe that the query returns
secretDatasuccessfully, bypassing the@authenticateddirective.
Expected Result: Unauthorized access to sensitive data.
Blue Team
Detection:
- Monitor GraphQL queries for inline fragments that target object types implementing interfaces with access control directives.
- Look for queries that access fields that should be protected by
@authenticated,@requiresScopes, or@policydirectives but are accessed without proper authentication.
Mitigation:
- Immediately upgrade Apollo Federation composition logic to versions 2.9.5, 2.10.4, 2.11.5, or 2.12.1.
- As a workaround, manually copy access control directives from interface types/fields to all implementing object types/fields.
- Do not remove access control directives from interface types/fields until the patch is applied, as unpatched composition will not generate them in the supergraph schema.
Indicators of Compromise (IOCs)
- Network: GraphQL queries containing inline fragments targeting object types that implement interfaces with access control directives.
- Logs: Apollo Router logs showing successful queries to fields that should be protected by
@authenticated,@requiresScopes, or@policydirectives without proper authentication. - Schema: Supergraph schema generated by vulnerable composition logic that lacks access control directives on implementing object types/fields.
Detection Engineering
YARA Rule
rule CVE_2025_64530_Apollo_Federation_Bypass {
meta:
description = "Detects GraphQL queries attempting to bypass access controls via inline fragments in Apollo Federation"
author = "Valters IT"
date = "2025-04-10"
severity = "high"
strings:
$inline_fragment = "... on "
$field_access = /\.\.\.\s+on\s+\w+\s*\{[^}]*\}/
condition:
$inline_fragment and $field_access
}
Sigma Rule
title: Apollo Federation Access Control Bypass via Inline Fragments
id: 8a9b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d
status: experimental
description: Detects GraphQL queries that use inline fragments to bypass access controls on interface types/fields in Apollo Federation.
author: Valters IT
date: 2025-04-10
logsource:
category: application
product: apollo_router
detection:
selection:
query|contains: "... on "
condition: selection
falsepositives:
- Legitimate use of inline fragments for other purposes
level: high
Suricata Rule
alert http any any -> any any (msg:"CVE-2025-64530 Apollo Federation Access Control Bypass via Inline Fragments"; flow:to_server; content:"... on "; http_client_body; pcre:"/\.\.\.\s+on\s+\w+\s*\{[^}]*\}/"; classtype:attempted-recon; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Upgrade Apollo Federation composition logic to versions 2.9.5, 2.10.4, 2.11.5, or 2.12.1.
- If upgrade is not immediately possible, manually copy access control directives from interface types/fields to all implementing object types/fields.
- Do not remove access control directives from interface types/fields until the patch is applied.
Long-term Measures:
- Implement strict validation of GraphQL schemas to ensure access control directives are not placed on interface types/fields.
- Use automated tools to scan supergraph schemas for missing access control directives on implementing object types/fields.
- Monitor Apollo Router logs for suspicious queries that attempt to bypass access controls.
Workarounds:
- For users of Apollo Rover with an unpatched composition version or using Apollo Studio build pipeline with Federation version 2.8 or below, manually copy access control requirements to each implementing object type/field.
- Customers not using Apollo Router access control features (
@authenticated,@requiresScopes, or@policydirectives) or not specifying access control requirements on interface types/fields are not affected.
Valters IT
DevSecOps & Cyber Threat Intelligence Expert