# Apollo Gateway prototype pollution via deepMerge

Source: https://junglewise.ai/threats/apollo-gateway-prototype-pollution-via-deepmerge-d1328d9d  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2019-06-13. Updated: 2026-09-25  
License: CC BY 4.0 with a link back

Severity: low · CVSS 3.1 · Published 2019-06-13

Apollo Gateway is a component that helps federate multiple GraphQL services. Versions before 0.6.2 contain a flaw in its object-merging logic that allows attackers to craft malicious GraphQL queries that corrupt the behavior of all objects in the application, potentially causing service outages or enabling further attacks.

Technologies: [@apollo/gateway (npm)](https://junglewise.ai/threats/technologies/apollo-gateway). Vendors: [npm](https://junglewise.ai/threats/vendors/npm).

## Quick answers

**Is This vulnerability exploited in the wild?** No. Junglewise Threat Intelligence has no report of This vulnerability being exploited in the wild.

**How severe is This vulnerability?** Low severity, with a CVSS score of 3.1, published 13 June 2019.

**Which products and versions are affected?** @apollo/gateway (npm) SEMVER:introduced=0,fixed=0.6.2.

**Is there a fix for This vulnerability?** Yes. @apollo/gateway (npm): upgrade to 0.6.2 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is This vulnerability attacked?** It is attacked over the network, in a software library.

**Am I affected?** Check whether you run @apollo/gateway (npm) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- @apollo/gateway (npm): upgrade to 0.6.2 or later

  ```sh
  npm install @apollo/gateway@0.6.2
  ```


## Technical details

The vulnerability is a prototype pollution flaw in the deepMerge() utility function used by @apollo/gateway. The function failed to filter the __proto__ property when merging objects, allowing attackers to inject payloads through GraphQL aliases that modify Object.prototype. This affects all versions prior to 0.6.2. The attack is network-reachable and requires no authentication. An attacker can manipulate application state to cause denial of service or potentially chain the vulnerability with other issues to achieve remote code execution. The fix, released in version 0.6.2, adds filtering to ignore __proto__ fields during the merge operation.

## Affected products

- Apollo @apollo/gateway before 0.6.2

## Timeline

- 2019-06-13: disclosed
- 2019-06-04: patched: PR #2779 merged; version 0.6.2 released shortly after

## References

- [https://github.com/apollographql/apollo-server/pull/2779](https://github.com/apollographql/apollo-server/pull/2779)
- [https://github.com/apollographql/apollo-server/commit/cea7397582a293af6a5f60947da34b95e669c6c1](https://github.com/apollographql/apollo-server/commit/cea7397582a293af6a5f60947da34b95e669c6c1)

## Related threats

- [Apollo Gateway Query Planner denial of service via optimization bypass](https://junglewise.ai/threats/cve-2025-32031-apollo-gateway-query-planner-denial-of-service-via-optimization)
- [Apollo Gateway query planner denial of service via fragment expansion](https://junglewise.ai/threats/cve-2025-32030-apollo-gateway-query-planner-denial-of-service-via-fragment)
- [Apollo Query Planner infinite loop on complex queries](https://junglewise.ai/threats/cve-2024-43414-apollo-query-planner-infinite-loop-on-complex-queries)
