GHSA-68jh-rf6x-836f

Suggest an improvement
Source
https://github.com/advisories/GHSA-68jh-rf6x-836f
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2023/06/GHSA-68jh-rf6x-836f/GHSA-68jh-rf6x-836f.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-68jh-rf6x-836f
Published
2023-06-16T19:40:53Z
Modified
2023-06-20T19:50:40Z
Summary
@apollo/server vulnerable to unsafe application of Content Security Policy via reused nonces
Details

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/

Database specific
{
    "github_reviewed_at": "2023-06-16T19:40:53Z",
    "severity": "LOW",
    "cwe_ids": [],
    "github_reviewed": true,
    "nvd_published_at": null
}
References

Affected packages

npm / @apollo/server

Package

Name
@apollo/server
View open source insights on deps.dev
Purl
pkg:npm/%40apollo/server

Affected ranges

Type
SEMVER
Events
Introduced
4.7.1
Fixed
4.7.4