GHSA-68jh-rf6x-836f: @apollo/server @apollo/server Vulnerable To Unsafe Application Vulnerability

LOW
Published
Advisory Summary

GHSA-68jh-rf6x-836f is a LOW @apollo/server vulnerable to unsafe application vulnerability (General Security Weakness) affecting @apollo/server libraries in the npm ecosystem. The issue involves @apollo/server vulnerable to unsafe application of content security policy via reused nonces. Remediation is available by upgrading affected packages to version 4.7.4.

GHSA-68jh-rf6x-836f at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-68jh-rf6x-836f
Severity LOW
CVSS v3.1 Base Score N/A
CWE Classification General Security Weakness
Affected Product @apollo/server
Package Ecosystem npm
Published Date
Last Updated

How to Fix GHSA-68jh-rf6x-836f

To remediate this vulnerability, upgrade all affected @apollo/server 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/server fixed: 4.7.4
npm install @apollo/server@4.7.4
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/server

How to Check if You Are Affected

To determine whether your Node.js application is affected by GHSA-68jh-rf6x-836f, inspect your project dependencies using npm:

npm ls @apollo/server

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

Note: The npm ls @apollo/server 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 General Security Weakness. In @apollo/server, 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

### Context Content Security Policies (CSP) are a defense-in-depth strategy against XSS attacks. Improper application of CSP isn't itself a vulnerability, but it does fail to prevent XSS in the event that there is a viable attack vector for an XSS attack. ### Impact There aren't any XSS attack vectors via the Apollo Server landing pages _known to Apollo_, so to our knowledge there is no impact. However, if there are existing XSS vectors that haven't been reported and patched, then all users of Apollo Server's landing pages have a vulnerability which won't be prevented by the current CSP implemented by the landing pages. Prior to version 4.7.1, there was no CSP implemented at all. However, the initial CSP implementation (4.7.1+) reused nonces. While this sufficiently resolved the issue w.r.t. scripts not running in Safari, it did not implement CSP in a safe or conventional way. ### Patches The issue is patched in the latest version of Apollo Server, v4.7.4. The changes can be reviewed in [the merge commit](https://github.com/apollographql/apollo-server/commit/0adaf80d1ee51d8c7e5fd863c04478536d15eb8c). ### Workarounds The landing page can be disabled completely until the patch can be upgraded to. https://www.apollographql.com/docs/apollo-server/api/plugin/landing-pages/#disabling-the-landing-page ### References https://content-security-policy.com/nonce/

GHSA-68jh-rf6x-836f Affected @apollo/server Versions

1 component(s)
Fixed Versions:
4.7.4
Product / Package Ecosystem Affected Versions Fixed Version
@apollo/server
npm
≥ 4.7.1
< 4.7.4
4.7.4

References

Frequently Asked Questions

What is GHSA-68jh-rf6x-836f?
GHSA-68jh-rf6x-836f is a security vulnerability in @apollo/server involving @apollo/server vulnerable to unsafe application of Content Security Policy via reused nonces under General Security Weakness.
Which @apollo/server versions are affected?
Affected versions include releases prior to 4.7.4 across affected packages: @apollo/server.
What version fixes GHSA-68jh-rf6x-836f?
Upgrading to 4.7.4 (or the latest patched release for your respective branch) resolves the vulnerability.
Is @apollo/server affected?
Yes, @apollo/server is affected in releases prior to 4.7.4. Upgrade your dependency to 4.7.4 or later.
What CWE is associated with GHSA-68jh-rf6x-836f?
GHSA-68jh-rf6x-836f is classified under General Security Weakness.
How can I check npm dependencies for GHSA-68jh-rf6x-836f?
Run the dependency tree command: 'npm ls @apollo/server'. 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-68jh-rf6x-836f",
  "modified" : "2023-06-20T19:50:40Z",
  "published" : "2023-06-16T19:40:53Z",
  "aliases" : [ ],
  "summary" : "@apollo/server vulnerable to unsafe application of Content Security Policy via reused nonces",
  "details" : "### Context\nContent Security Policies (CSP) are a defense-in-depth strategy against XSS attacks. Improper application of CSP isn't itself a vulnerability, but it does fail to prevent XSS in the event that there is a viable attack vector for an XSS attack.\n\n### Impact\nThere aren't any XSS attack vectors via the Apollo Server landing pages _known to Apollo_, so to our knowledge there is no impact. However, if there are existing XSS vectors that haven't been reported and patched, then all users of Apollo Server's landing pages have a vulnerability which won't be prevented by the current CSP implemented by the landing pages.\n\nPrior to version 4.7.1, there was no CSP implemented at all. However, the initial CSP implementation (4.7.1+) reused nonces. While this sufficiently resolved the issue w.r.t. scripts not running in Safari, it did not implement CSP in a safe or conventional way.\n\n### Patches\nThe issue is patched in the latest version of Apollo Server, v4.7.4. The changes can be reviewed in [the merge commit](https://github.com/apollographql/apollo-server/commit/0adaf80d1ee51d8c7e5fd863c04478536d15eb8c).\n\n### Workarounds\nThe landing page can be disabled completely until the patch can be upgraded to.\nhttps://www.apollographql.com/docs/apollo-server/api/plugin/landing-pages/#disabling-the-landing-page\n\n### References\nhttps://content-security-policy.com/nonce/",
  "severity" : [ ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@apollo/server"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "4.7.1"
      }, {
        "fixed" : "4.7.4"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/apollographql/apollo-server/security/advisories/GHSA-68jh-rf6x-836f"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/apollographql/apollo-server/commit/0adaf80d1ee51d8c7e5fd863c04478536d15eb8c"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/apollographql/apollo-server"
  } ],
  "database_specific" : {
    "cwe_ids" : [ ],
    "severity" : "LOW",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-06-16T19:40:53Z",
    "nvd_published_at" : null
  }
}