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.
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.
A new Query Fragment Expansion Limit metric has been introduced:
This has been remediated in @apollo/gateway version 2.10.1.
No known direct workarounds exist.
We appreciate the efforts of the security community in identifying and improving the performance and security of query planning mechanisms.
{
"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"
}