{"answers":{"affected":"6 open source packages ship an affected version, including apollo-router, @apollo/gateway and @apollo/query-planner. It affects 5 products.","exploited":"There is no known exploitation of CVE-2024-43414 in the wild and no public exploit code.","fix":"Upgrade apollo-router to 1.52.1 or later.","what":"CVE-2024-43414 is a high-severity denial of service vulnerability in apollographql federation, published on 27 Aug 2024. An attacker can exploit it over the internet without logging in, with no action from the victim."},"fix_prompt":"Check this codebase for CVE-2024-43414 and fix it if it is affected.\n\nWhat it is: CVE-2024-43414 is a high-severity denial of service vulnerability in apollographql federation, published on 27 Aug 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.\nExploitation: There is no known exploitation of CVE-2024-43414 in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- apollo-router (crates.io): affected all versions; fixed in 1.52.1\n- apollo-router (crates.io): affected all versions; fixed in 1.52.1\n- @apollo/gateway (npm): affected from 2.0.0; fixed in 2.8.5\n- @apollo/gateway (npm): affected from 2.0.0; fixed in 2.8.5\n- @apollo/query-planner (npm): affected from 2.0.0; fixed in 2.8.5\n- @apollo/query-planner (npm): affected from 2.0.0; fixed in 2.8.5\n\nTask:\n1. 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.\n2. 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.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/CVE-2024-43414/ (Markdown: https://insights.sbomify.com/CVE-2024-43414/index.md)","id":"CVE-2024-43414","markdown":"https://insights.sbomify.com/CVE-2024-43414/index.md","name":"CVE-2024-43414","record":{"aliases":["GHSA-fmj9-77q8-g6c4","ROOT-APP-NPM-CVE-2024-43414"],"analysis":{"component_type":"library","fix_type":"upgrade","impacts":["denial_of_service"],"network_reachable":"yes","non_default_config":false,"product_category":"Apollo GraphQL library","requires_auth":"none","summary":"Attackers can cause denial of service in Apollo GraphQL services by submitting complex queries that trigger infinite loops and memory exhaustion.","user_interaction":"not_required","vuln_class":"denial_of_service"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"GitHub_M","cpe":[{"product":"apollo-router","vendor":"apollographql"},{"product":"apollo_gateway","vendor":"apollographql"},{"product":"apollo_helms-charts_router","vendor":"apollographql"},{"product":"apollo_query-planner","vendor":"apollographql"},{"product":"apollo_router","vendor":"apollographql"}],"cvss":{"score":7.5,"severity":"high","source":"cna","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","version":"3.1"},"cwes":[{"id":"CWE-674","name":"Uncontrolled Recursion"}],"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 \u003e=2.0.0 and \u003c2.8.5 are impacted by a denial-of-service vulnerability. @apollo/gateway versions \u003e=2.0.0 and \u003c 2.8.5 and Apollo Router \u003c1.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.","ecosystems":["crates.io","npm"],"exploits":{"exploitdb":0,"first_seen":null,"github_poc":0,"max_poc_stars":null,"metasploit":0,"nuclei":0,"refs":[],"tier":"none_known"},"has_fix":true,"headline":"Apollo Query Planner and Apollo Gateway may infinitely loop on sufficiently complex queries","id":"CVE-2024-43414","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"crates.io","product":null,"products":[],"type":"denial_of_service","year":"2024"},"n_packages":6,"n_references":3,"next":{"headline":"Decidim-Awesome: SQL injection in AdminAccountability","id":"CVE-2024-43415"},"packages":[{"ecosystem":"crates.io","fixed":["1.52.1"],"introduced":["0"],"last_affected":[],"package":"apollo-router","purl":null,"source":"GHSA-fmj9-77q8-g6c4"},{"ecosystem":"crates.io","fixed":["1.52.1"],"introduced":["0"],"last_affected":[],"package":"apollo-router","purl":"pkg:cargo/apollo-router","source":"GHSA-fmj9-77q8-g6c4"},{"ecosystem":"npm","fixed":["2.8.5"],"introduced":["2.0.0"],"last_affected":[],"package":"@apollo/gateway","purl":null,"source":"GHSA-fmj9-77q8-g6c4"},{"ecosystem":"npm","fixed":["2.8.5"],"introduced":["2.0.0"],"last_affected":[],"package":"@apollo/gateway","purl":"pkg:npm/%40apollo/gateway","source":"GHSA-fmj9-77q8-g6c4"},{"ecosystem":"npm","fixed":["2.8.5"],"introduced":["2.0.0"],"last_affected":[],"package":"@apollo/query-planner","purl":null,"source":"GHSA-fmj9-77q8-g6c4"},{"ecosystem":"npm","fixed":["2.8.5"],"introduced":["2.0.0"],"last_affected":[],"package":"@apollo/query-planner","purl":"pkg:npm/%40apollo/query-planner","source":"GHSA-fmj9-77q8-g6c4"}],"prev":{"headline":"Xibo CMS XSS vulnerability using DataSet HTML columns","id":"CVE-2024-43413"},"products":["federation"],"published":"2024-08-27","related":[{"cvss_score":7.5,"headline":"Apollo Router Coprocessors may cause Denial-of-Service when handling request bodies","id":"CVE-2024-43783","kev_date_added":null,"published":"2024-08-27"}],"sources":[{"class":"attribution","licence":"CVE Terms of Use (MITRE)","name":"CVE List","prefix":"CVE"},{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"},{"class":"attribution","licence":"US public information, NVD API terms","name":"NVD"},{"class":"attribution","licence":"CWE Terms of Use","name":"CWE (MITRE)"},{"class":"attribution","licence":"FIRST CVSS licence","name":"CVSS (FIRST)"}],"ssvc":{"automatable":"yes","exploitation":"none","technical_impact":"partial"},"state":"PUBLISHED","updated":"2024-08-27","vendors":["apollographql"]},"summary":"Attackers can cause denial of service in Apollo GraphQL services by submitting complex queries that trigger infinite loops and memory exhaustion.","url":"https://insights.sbomify.com/CVE-2024-43414/"}