GHSA-q2f9-x4p4-7xmh

Suggest an improvement
Source
https://github.com/advisories/GHSA-q2f9-x4p4-7xmh
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2025/04/GHSA-q2f9-x4p4-7xmh/GHSA-q2f9-x4p4-7xmh.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-q2f9-x4p4-7xmh
Aliases
Published
2025-04-07T19:03:10Z
Modified
2025-04-08T17:50:55Z
Severity
  • 7.5 (High) CVSS_V3 - CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H CVSS Calculator
Summary
Apollo Gateway Query Planner Vulnerable to Excessive Resource Consumption via Named Fragment Expansion
Details

Impact

Summary

A vulnerability in Apollo Gateway allowed queries with deeply nested and reused named fragments to be prohibitively expensive to query plan, specifically during named fragment expansion. This could lead to excessive resource consumption and denial of service.

Details

Named fragments were being expanded once per fragment spread during query planning, leading to exponential resource usage when deeply nested and reused fragments were involved.

Fix/Mitigation

A new Query Fragment Expansion Limit metric has been introduced:

  • This metric computes the number of selections a query would have if its fragment spreads were fully expanded.
  • The metric is checked against a limit to prevent excessive computation.

Patches

This has been remediated in @apollo/gateway version 2.10.1.

Workarounds

No known direct workarounds exist.

References

Query Planning Documentation

Acknowledgements

We appreciate the efforts of the security community in identifying and improving the performance and security of query planning mechanisms.

Database specific
{
    "cwe_ids":  [
        "CWE-770"
    ],
    "github_reviewed":  true,
    "github_reviewed_at":  "2025-04-07T19:03:10Z",
    "nvd_published_at":  "2025-04-07T21:15:43Z",
    "severity":  "HIGH"
}
References

Affected packages

npm / @apollo/gateway

Package

Name
@apollo/gateway
View open source insights on deps.dev
Purl
pkg:npm/%40apollo/gateway

Affected ranges

Type
SEMVER
Events
Introduced
0 Unknown introduced version / All previous versions are affected
Fixed
2.10.1

Database specific

source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2025/04/GHSA-q2f9-x4p4-7xmh/GHSA-q2f9-x4p4-7xmh.json"