GHSA-74cr-77xc-8g6r: @apollo/gateway Prototype Pollution Vulnerability

HIGH
CVSS 7.3
CWE-1321 CWE-400
Published
Advisory Summary

GHSA-74cr-77xc-8g6r is a HIGH (CVSS 7.3) prototype pollution vulnerability (CWE-1321: Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution')) affecting @apollo/gateway libraries in the npm ecosystem. The issue involves prototype pollution in @apollo/gateway. Remediation is available by upgrading affected packages to version 0.6.2.

GHSA-74cr-77xc-8g6r at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-74cr-77xc-8g6r
Severity HIGH
CVSS v3.1 Base Score 7.3
CWE Classification CWE-1321: Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution')
Affected Product @apollo/gateway
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 7.3

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality Low (C:L)
Integrity Low (I:L)
Availability Low (A:L)

How to Fix GHSA-74cr-77xc-8g6r

To remediate this vulnerability, upgrade all affected @apollo/gateway dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

@apollo/gateway fixed: 0.6.2
npm install @apollo/gateway@0.6.2
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls @apollo/gateway

How to Check if You Are Affected

To determine whether your Node.js application is affected by GHSA-74cr-77xc-8g6r, inspect your project dependencies using npm:

npm ls @apollo/gateway

Analyze the terminal output to locate any version of @apollo/gateway in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.6.2), your application is affected.

Note: The npm ls @apollo/gateway command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-1321: Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution'), where the product receives input from an upstream component that specifies attributes that are to be initialized or updated in an object, but it does not properly control modifications of attributes of the object prototype. In @apollo/gateway, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

Versions of `@apollo/gateway` prior to 0.6.2 are vulnerable to Prototype Pollution. The package uses deepMerge() to merge objects, which may allow attackers to alter the Object prototype through queries with GraphQL aliases. Carefully constructed payloads can override properties of all objects in the application. This may lead to Denial of Service or may be chained with other vulnerabilities leading to Remote Code Execution. ## Recommendation Upgrade to version 0.6.2 or later.

GHSA-74cr-77xc-8g6r Affected @apollo/gateway Versions

1 component(s)
Fixed Versions:
0.6.2
Product / Package Ecosystem Affected Versions Fixed Version
@apollo/gateway
npm
< 0.6.2
0.6.2

References

Frequently Asked Questions

What is GHSA-74cr-77xc-8g6r?
GHSA-74cr-77xc-8g6r is a security vulnerability in @apollo/gateway involving Prototype Pollution in @apollo/gateway under CWE-1321: Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution').
Which @apollo/gateway versions are affected?
Affected versions include releases prior to 0.6.2 across affected packages: @apollo/gateway.
What version fixes GHSA-74cr-77xc-8g6r?
Upgrading to 0.6.2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is @apollo/gateway affected?
Yes, @apollo/gateway is affected in releases prior to 0.6.2. Upgrade your dependency to 0.6.2 or later.
What is the CVSS score of GHSA-74cr-77xc-8g6r?
GHSA-74cr-77xc-8g6r has a CVSS v3.1 base score of 7.3 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L.
What CWE is associated with GHSA-74cr-77xc-8g6r?
GHSA-74cr-77xc-8g6r is classified under CWE-1321: Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution') (The product receives input from an upstream component that specifies attributes that are to be initialized or updated in an object, but it does not properly control modifications of attributes of the object prototype.).
How can I check npm dependencies for GHSA-74cr-77xc-8g6r?
Run the dependency tree command: 'npm ls @apollo/gateway'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-74cr-77xc-8g6r",
  "modified" : "2021-08-16T15:28:22Z",
  "published" : "2019-06-13T20:37:39Z",
  "aliases" : [ ],
  "summary" : "Prototype Pollution in @apollo/gateway",
  "details" : "Versions of `@apollo/gateway` prior to 0.6.2 are vulnerable to Prototype Pollution. The package uses deepMerge() to merge objects, which may allow attackers to alter the Object prototype through queries with GraphQL aliases. Carefully constructed payloads can override properties of all objects in the application. This may lead to Denial of Service or may be chained with other vulnerabilities leading to Remote Code Execution.\n\n\n## Recommendation\n\nUpgrade to version 0.6.2 or later.\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@apollo/gateway"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.6.2"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/apollographql/apollo-server/pull/2779"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/apollographql/apollo-server/commit/cea7397582a293af6a5f60947da34b95e669c6c1"
  }, {
    "type" : "WEB",
    "url" : "https://snyk.io/vuln/SNYK-JS-APOLLOGATEWAY-174915"
  }, {
    "type" : "WEB",
    "url" : "https://www.npmjs.com/advisories/917"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-1321", "CWE-400" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2019-06-13T20:37:08Z",
    "nvd_published_at" : null
  }
}