Apollo Query Planner and Apollo Gateway may infinitely loop on sufficiently complex queries
Published Aug 27, 2024
8.7
HIGHCVSS 4.0
EPSS 0.99%
Description
Apollo Federation is an architecture for declaratively composing APIs into a unified graph. Each team can own their slice of the graph independently, empowering them to deliver autonomously and incrementally. Instances of @apollo/query-planner >=2.0.0 and <2.8.5 are impacted by a denial-of-service vulnerability. @apollo/gateway versions >=2.0.0 and < 2.8.5 and Apollo Router <1.52.1 are also impacted through their use of @apollo/query-panner. If @apollo/query-planner is asked to plan a sufficiently complex query, it may loop infinitely and never complete. This results in unbounded memory consumption and either a crash or out-of-memory (OOM) termination. This issue can be triggered if you have at least one non-@key field that can be resolved by multiple subgraphs. To identify these shared fields, the schema for each subgraph must be reviewed. The mechanism to identify shared fields varies based on the version of Federation your subgraphs are using. You can check if your subgraphs are using Federation 1 or Federation 2 by reviewing their schemas. Federation 2 subgraph schemas will contain a @link directive referencing the version of Federation being used while Federation 1 subgraphs will not. For example, in a Federation 2 subgraph, you will find a line like @link(url: "https://specs.apollo.dev/federation/v2.0"). If a similar @link directive is not present in your subgraph schema, it is using Federation 1. Note that a supergraph can contain a mix of Federation 1 and Federation 2 subgraphs. This issue results from the Apollo query planner attempting to use a Number exceeding Javascript’s Number.MAX_VALUE in some cases. In Javascript, Number.MAX_VALUE is (2^1024 - 2^971). When the query planner receives an inbound graphql request, it breaks the query into pieces and for each piece, generates a list of potential execution steps to solve the piece. These candidates represent the steps that the query planner will take to satisfy the pieces of the larger query. As part of normal operations, the query planner requires and calculates the number of possible query plans for the total query. That is, it needs the product of the number of query plan candidates for each piece of the query. Under normal circumstances, after generating all query plan candidates and calculating the number of all permutations, the query planner moves on to stack rank candidates and prune less-than-optimal options. In particularly complex queries, especially those where fields can be solved through multiple subgraphs, this can cause the number of all query plan permutations to balloon. In worst-case scenarios, this can end up being a number larger than Number.MAX_VALUE. In Javascript, if Number.MAX_VALUE is exceeded, Javascript represents the value as “infinity”. If the count of candidates is evaluated as infinity, the component of the query planner responsible for pruning less-than-optimal query plans does not actually prune candidates, causing the query planner to evaluate many orders of magnitude more query plan candidates than necessary. This issue has been addressed in @apollo/query-planner v2.8.5, @apollo/gateway v2.8.5, and Apollo Router v1.52.1. Users are advised to upgrade. This issue can be avoided by ensuring there are no fields resolvable from multiple subgraphs. If all subgraphs are using Federation 2, you can confirm that you are not impacted by ensuring that none of your subgraph schemas use the @shareable directive. If you are using Federation 1 subgraphs, you will need to validate that there are no fields resolvable by multiple subgraphs.
Affected products
-
- Version < 1.52.1StatusaffectedConstraints-
- Version >= 2.0.0, < 2.8.5StatusaffectedConstraints-
- Version
Default status is the baseline for the product, each version can override it (e.g. patched versions marked unaffected).
| Vendor | Product | Default status | Versions | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Apollographql | Federation | n/a |
|
- < 1.52.1
- ≥ 2.0.0 · < 2.8.5
- < 1.52.1
- ≥ 2.0.0 · < 2.8.5
- < 1.52.1
-
- Version 0StatusaffectedConstraints<1.52.1
- Version 2.0.0StatusaffectedConstraints<2.8.5
- Version
Default status is the baseline for the product, each version can override it (e.g. patched versions marked unaffected).
| Vendor | Product | Default status | Versions | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Apollographql | Federation | n/a |
|
No Red Hat product state for this CVE.
apollo-router
crates.io
Introduced 0 Fixed 1.52.1@apollo/query-planner
npm
Introduced 2.0.0 Fixed 2.8.5@apollo/gateway
npm
Introduced 2.0.0 Fixed 2.8.5
| Ecosystem | Package | Introduced | Fixed |
|---|---|---|---|
| crates.io | apollo-router | 0 | 1.52.1 |
| npm | @apollo/query-planner | 2.0.0 | 2.8.5 |
| npm | @apollo/gateway | 2.0.0 | 2.8.5 |
Remediation
No remediation recorded yet.
Metrics
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
No CVSS v3.0 score for this CVE.
No CVSS v2.0 score for this CVE.
This CVE is not in the KEV list.
CISA SSVC (Vulnrichment)
Stakeholder-Specific Vulnerability Categorization from CISA ADP.
Exploitation
NoneAutomatable
YesTechnical Impact
PartialDecision
n/aAssessed Aug 27, 2024 · SSVC 2.0.3
Estimated probability of exploitation in the wild in the next 30 days (FIRST EPSS). As of Oct 1, 2026.
Score over time
2024–2026- EPSS v3
- EPSS v4
- EPSS v5
Percentile over time
- EPSS v3
- EPSS v4
- EPSS v5
Table of values (5 key points)
Flat stretches are collapsed; showing up to 120 newest points.
| Date | Score | Percentile | Model |
|---|---|---|---|
| Oct 1, 2026 | 0.99% (0.00988) | 61.11th | v5 (v2026.06.15) |
| Jun 15, 2026 | 0.99% (0.00988) | 57.75th | v5 (v2026.06.15) |
| Mar 17, 2025 | 0.19% (0.00195) | 39.33th | v4 (v2025.03.14) |
| Dec 12, 2024 | 0.06% (0.00059) | 27.15th | v3 (v2023.03.01) |
| Aug 28, 2024 | 0.04% (0.00045) | 16.33th | v3 (v2023.03.01) |
References (6)
- https://github.com/advisories/GHSA-fmj9-77q8-g6c4 Advisory
- https://github.com/apollographql/federation/security/advisories/GHSA-fmj9-77q8-g6c4 x_refsource_CONFIRMExploit
- https://github.com/apollographql/router/commit/e309c9bb5a48c1304ff69c88b7eabdd08c26bf45
- https://nvd.nist.gov/vuln/detail/CVE-2024-43414
- https://www.apollographql.com/docs/federation/query-plans x_refsource_MISCTechnical Description
- https://www.apollographql.com/docs/router/configuration/persisted-queries x_refsource_MISCTechnical Description
| Link | Providers | Tags |
|---|---|---|
| https://github.com/advisories/GHSA-fmj9-77q8-g6c4 | Advisory | |
| https://github.com/apollographql/federation/security/advisories/GHSA-fmj9-77q8-g6c4 | x_refsource_CONFIRMExploit | |
| https://github.com/apollographql/router/commit/e309c9bb5a48c1304ff69c88b7eabdd08c26bf45 | ||
| https://nvd.nist.gov/vuln/detail/CVE-2024-43414 | ||
| https://www.apollographql.com/docs/federation/query-plans | x_refsource_MISCTechnical Description | |
| https://www.apollographql.com/docs/router/configuration/persisted-queries | x_refsource_MISCTechnical Description |
Change history (0)
No recorded changes yet.