Advisory Database
  • Advisories
  • Dependency Scanning
  1. npm
  2. ›
  3. @apollo/query-planner
  4. ›
  5. CVE-2024-43414

CVE-2024-43414: Apollo Query Planner and Apollo Gateway may infinitely loop on sufficiently complex queries

August 27, 2024 (updated September 13, 2024)

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-planner.

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.

To review Federation 1 subgraphs for impact:

In Federation 1 subgraphs, fields are implicitly shareable across subgraphs. To review for impact, you will need to review for cases where multiple subgraphs can resolve the same field. For example:

References

  • github.com/advisories/GHSA-fmj9-77q8-g6c4
  • github.com/apollographql/federation
  • github.com/apollographql/federation/security/advisories/GHSA-fmj9-77q8-g6c4
  • github.com/apollographql/router/commit/e309c9bb5a48c1304ff69c88b7eabdd08c26bf45
  • nvd.nist.gov/vuln/detail/CVE-2024-43414
  • www.apollographql.com/docs/federation/query-plans
  • www.apollographql.com/docs/router/configuration/persisted-queries

Code Behaviors & Features

Detect and mitigate CVE-2024-43414 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions starting from 2.0.0 before 2.8.5

Fixed versions

  • 2.8.5

Solution

Upgrade to version 2.8.5 or above.

Impact 7.5 HIGH

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

Learn more about CVSS

Weakness

  • CWE-673: External Influence of Sphere Definition
  • CWE-674: Uncontrolled Recursion

Source file

npm/@apollo/query-planner/CVE-2024-43414.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Wed, 14 May 2025 12:15:11 +0000.