Low

@apollo/server vulnerable to unsafe application of Content Security Policy via reused nonces

  • Disclosed: 16.06.2023
  • Updated: 11.10.2026 10:22

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.

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/

Affected software

Click a technology to see all vulnerabilities affecting it.

PlatformPackageVulnerable versionsFixed in
npm package @apollo/server >= 4.7.1, < 4.7.4 4.7.4

References

CVSS score -
Weakness (CWE)
-
Platform
npm
Package
@apollo/server
Disclosed
16.06.2023
Updated
11.10.2026 10:22

Sources and licenses

OSV / GitHub Advisory Database - GHSA-68jh-rf6x-836f - CC BY 4.0

Vulnerability history: @apollo/server

All published vulnerabilities of this package (npm package), newest first. Shows whether this is a one-off slip or a package that needs watching.

Total entries
5
First → latest
11.2022 03.2026
Without a fix
0
Exploited in attacks
0

Severity breakdown

  • High 1
  • Medium 2
  • Low 2

Disclosures per year

  1. 2022: 1
  2. 2023: 2
  3. 2024: 0
  4. 2025: 0
  5. 2026: 2
  1. High · 7.5 CVE-2026-23897 >= 4.2.0, < 4.13.0, >= 5.0.0, < 5.4.0 4.13.0, 5.4.0
  2. Low ghsa-j5g3-5c8r-7qfx < 4.9.3 4.9.3
  3. @apollo/server vulnerable to unsafe application of Content Security Policy via reused nonces this entry
    Low ghsa-68jh-rf6x-836f >= 4.7.1, < 4.7.4 4.7.4

Know which vulnerabilities affect your application

With the DockRay integration and software inventory enabled, DockRay checks reported component versions against known vulnerabilities and notifies you about confirmed matches. Coverage depends on the supported technology and available advisory data.

Connect your application
DockRay newsletter

Application security in your inbox

Important vulnerabilities, actionable guidance and practical advice for your applications. Choose your technologies and follow what matters to your project.

  • A daily digest of new vulnerabilities, critical ones included.
  • Notifications about important updates.
  • Practical advice on application security and monitoring.

Leave empty to receive updates for every technology.

Free to subscribe. Unsubscribe with one click in any email.