# GHSA-m8jr-fxqx-8xx6: Apollo Federation has Improper Enforcement of Access Control on Transitive Fields

> Attackers can bypass field-level access controls in Apollo Federation to read protected data via transitive dependencies, affecting GraphQL API security.

- **Severity:** Not scored
- **Exploited in the wild:** Not known
- **Login needed:** Any signed-in user
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 14 Nov 2025

## What is GHSA-m8jr-fxqx-8xx6?

GHSA-m8jr-fxqx-8xx6 is a missing authorization vulnerability in @apollo/composition, published on 14 Nov 2025. Any signed-in user can exploit it over the network, with no action from the victim.

### Official description

# Summary
A vulnerability in Apollo Federation's composition logic did not enforce that fields depending on protected data through `@requires` and/or `@fromContext` directives have the same access control requirements as the fields they reference. This allowed queries to access protected fields indirectly through their dependencies, bypassing access control checks. A fix to composition logic in Federation now enforces that dependent fields match the access control requirements from of the fields they reference.

## Details
Apollo Federation allows users to specify [`@authenticated`, `@requiresScopes`, and `@policy` directives](https://www.apollographql.com/docs/graphos/routing/security/authorization#authorization-directives) to protect fields at the field level. The `@requires` directive allows a field to depend on data from other fields in the schema, and `@fromContext` allows a field to use values from the execution context. However, Apollo Router does not enforce access control requirements on these transitively-accessed fields, and Apollo Federation did not require that fields using `@requires` or `@fromContext` have the same access control as the fields they depend on. 

At execution time, when a field decorated with `@requires` or `@fromContext` was resolved, the Router would fetch the required dependency fields from subgraphs without checking whether those fields had their own access control requirements. Access control directives applied to these dependency fields were only enforced when those fields appeared explicitly in the query. If the protected fields were accessed solely as transitive dependencies (in other words, fetched to satisfy `@requires` or `@fromContext` but not directly requested) their access control requirements were silently ignored.

This discrepancy between where access controls could be defined (on any field) and where it was enforced (only on explicitly queried fields) leads to unexpected runtime security gaps.

## Who is impacted
This vulnerability impacts Apollo Federation customers with supergraphs defining `@authenticated`, `@requiresScopes`, or `@policy` directives on fields that are also specified as dependencies in `@requires` or `@fromContext` directives.

### Scope of Impact
The vulnerability could allow a malicious actor to craft a query that indirectly accesses protected fields, allowing them to bypass field-level access control. By querying only fields that depend on protected data (via `@requires` or `@fromContext`) without explicitly requesting the protected fields themselves, an attacker could retrieve sensitive information without meeting the access control requirements. 

## Patches
This vulnerability has been fixed in Apollo Federation by updating composition logic to validate that access control requirements on `@requires` and `@fromContext` dependency fields match the resolving field's requirements.

_Note that this is a breaking change to Apollo Federation, as it no longer allows fields using `@requires` or `@fromContext` to have different access control directives from the fields they depend on. You will need to update your subgraphs to ensure that the access control requirements on fields using `@requires` or `@fromContext` match the access control directives on the referenced fields._

If you are using the Apollo Studio build pipeline with Federation version 2.9 or above, then this patch version update is automatic and you only need to adjust the access control requirements in your subgraph schemas as mentioned above.

If you are using Apollo Rover for local composition, you will need to update its composition version (after updating Apollo Router, [if necessary](https://www.apollographql.com/docs/graphos/platform/graph-management/updates#recommended-update-order)) to one of the following versions:

- 2.9.5+
- 2.10.4+
- 2.11.5+
- 2.12.1+

You will then need to adjust the access control requirements in your subgraph schemas as mentioned above.

## Workarounds
- If you are using Apollo Rover with an unpatched composition version or are using the Apollo Studio build pipeline with Federation version 2.8 or below, you should review your schema for any sensitive fields that are accessed via `@requires` or `@fromContext` and explicitly apply matching access control directives on those transitive fields. Alternatively, consider restructuring your schema so that protected fields are queried directly.
* Customers not using Apollo Router access control features (`@authenticated`, `@requiresScopes`, or `@policy` directives) or not using `@requires` or `@fromContext` directives in combination with field-level access control are not affected and do not need to take action.

## Which versions are affected by GHSA-m8jr-fxqx-8xx6?

8 open source packages ship an affected version, including @apollo/composition.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `@apollo/composition` | npm | All versions | 2.9.5 |
| `@apollo/composition` | npm | All versions | 2.9.5 |
| `@apollo/composition` | npm | From 2.10.0-alpha.3 | 2.10.4 |
| `@apollo/composition` | npm | From 2.10.0-alpha.3 | 2.10.4 |
| `@apollo/composition` | npm | From 2.11.0-preview.1 | 2.11.5 |
| `@apollo/composition` | npm | From 2.11.0-preview.1 | 2.11.5 |
| `@apollo/composition` | npm | From 2.12.0-preview.0 | 2.12.1 |
| `@apollo/composition` | npm | From 2.12.0-preview.0 | 2.12.1 |

## How do I fix GHSA-m8jr-fxqx-8xx6?

Upgrade @apollo/composition to a fixed version for your release line: 2.9.5, 2.10.4, 2.11.5 or 2.12.1.

## Is GHSA-m8jr-fxqx-8xx6 being exploited?

There is no known exploitation of GHSA-m8jr-fxqx-8xx6 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-m8jr-fxqx-8xx6 and fix it if it is affected.

What it is: GHSA-m8jr-fxqx-8xx6 is a missing authorization vulnerability in @apollo/composition, published on 14 Nov 2025. Any signed-in user can exploit it over the network, with no action from the victim.
Exploitation: There is no known exploitation of GHSA-m8jr-fxqx-8xx6 in the wild and no public exploit code.

Affected packages and fixed versions:
- @apollo/composition (npm): affected all versions; fixed in 2.9.5
- @apollo/composition (npm): affected all versions; fixed in 2.9.5
- @apollo/composition (npm): affected from 2.10.0-alpha.3; fixed in 2.10.4
- @apollo/composition (npm): affected from 2.10.0-alpha.3; fixed in 2.10.4
- @apollo/composition (npm): affected from 2.11.0-preview.1; fixed in 2.11.5
- @apollo/composition (npm): affected from 2.11.0-preview.1; fixed in 2.11.5
- @apollo/composition (npm): affected from 2.12.0-preview.0; fixed in 2.12.1
- @apollo/composition (npm): affected from 2.12.0-preview.0; fixed in 2.12.1

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/GHSA-m8jr-fxqx-8xx6/ (Markdown: https://insights.sbomify.com/GHSA-m8jr-fxqx-8xx6/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-m8jr-fxqx-8xx6

---
From sbomify Insights: https://insights.sbomify.com/GHSA-m8jr-fxqx-8xx6/
Summaries are generated and may contain mistakes; the official description above is the record.
