GHSA-qf34-qpr4-5pph

Suggest an improvement
Source
https://github.com/advisories/GHSA-qf34-qpr4-5pph
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2025/07/GHSA-qf34-qpr4-5pph/GHSA-qf34-qpr4-5pph.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-qf34-qpr4-5pph
Aliases
Published
2025-07-09T22:40:06Z
Modified
2025-07-09T23:12:26Z
Severity
  • 10.0 (Critical) CVSS_V3 - CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H CVSS Calculator
Summary
docusaurus-plugin-content-gists vulnerability exposes GitHub Personal Access Token
Details

GitHub Personal Access Token Exposure in docusaurus-plugin-content-gists

Summary

docusaurus-plugin-content-gists versions prior to 4.0.0 are vulnerable to exposing GitHub Personal Access Tokens in production build artifacts when passed through plugin configuration options. The token, intended for build-time API access only, is inadvertently included in client-side JavaScript bundles, making it accessible to anyone who can view the website's source code.

Affected Versions

  • All versions < 4.0.0

Patched Versions

  • Version 4.0.0 and later

Impact

When using the affected versions with the recommended configuration pattern:

plugins: [
  [
    'docusaurus-plugin-content-gists',
    {
      personalAccessToken: process.env.GITHUB_PERSONAL_ACCESS_TOKEN,
    },
  ],
]

The GitHub Personal Access Token is included in the webpack bundle and exposed in production builds at:

  • /build/assets/js/main.[hash].js

This allows malicious actors to:

  • Extract the GitHub Personal Access Token from the website's JavaScript files
  • Use the stolen token to access the token owner's GitHub account with the granted permissions
  • Potentially access private gists, repositories, or perform other actions depending on the token's scope

Mitigation steps

  1. Immediately revoke access to the GitHub PAT that was used: https://github.com/settings/tokens

Migration steps

  1. Update to version 4.0.0+: npm install docusaurus-plugin-content-gists@^4.0.0
  2. Remove personalAccessToken from your plugin configuration
  3. Ensure GH_PERSONAL_ACCESS_TOKEN is set in your build environment
Database specific
{
    "cwe_ids": [
        "CWE-200"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2025-07-09T22:40:06Z",
    "nvd_published_at": "2025-07-09T21:15:27Z",
    "severity": "CRITICAL"
}
References

Affected packages

npm / docusaurus-plugin-content-gists

Package

Name
docusaurus-plugin-content-gists
View open source insights on deps.dev
Purl
pkg:npm/docusaurus-plugin-content-gists

Affected ranges

Type
SEMVER
Events
Introduced
0 Unknown introduced version / All previous versions are affected
Fixed
4.0.0

Database specific

source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2025/07/GHSA-qf34-qpr4-5pph/GHSA-qf34-qpr4-5pph.json"