GHSA-68jh-rf6x-836f @apollo/server vulnerable to unsafe application of Content Security Policy via reused nonces

Not scored Published

Apollo Server's landing pages reused CSP nonces, failing to prevent XSS if other vectors exist, requiring an upgrade to fix.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
A user has to click or open something
Fix
Available

What is GHSA-68jh-rf6x-836f?

GHSA-68jh-rf6x-836f is a vulnerability in @apollo/server, published on 16 Jun 2023. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

Official description

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/

Which versions are affected by GHSA-68jh-rf6x-836f?

2 open source packages ship an affected version, including @apollo/server.

PackageAffectedFixed in
@apollo/server npmFrom 4.7.14.7.4
@apollo/server npmFrom 4.7.14.7.4

How do I fix GHSA-68jh-rf6x-836f?

Upgrade @apollo/server to 4.7.4 or later.

Is GHSA-68jh-rf6x-836f being exploited?

There is no known exploitation of GHSA-68jh-rf6x-836f in the wild and no public exploit code.

Sources

Is GHSA-68jh-rf6x-836f in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free