docusaurus-plugin-content-gists vulnerability exposes GitHub Personal Access Token

Description

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: [
  [
    &#x27;docusaurus-plugin-content-gists&#x27;,
    {
      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

Basic information

Type
reviewed
Severity
critical
Advisory on GitHub
Open advisory ↗
Repository advisory
Open repository advisory ↗
Source code
Browse source ↗
Published (advisory)
2025-07-09 22:40:06 UTC
Updated
2025-07-09 22:40:07 UTC
GitHub reviewed
2025-07-09 22:40:06 UTC
NVD published
2025-07-09

EPSS Score

Score Percentile
9.12% 92.68%

CVSS Scores

Base score Version Severity Vector
10.0 3.1
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H Click to expand
Attack vector (AV:N)
Could be attacked over the internet or any normal routed network—not just someone sitting at the machine.
Attack complexity (AC:L)
Once they can reach the bug, pulling it off is straightforward—no weird race conditions or rare setup.
Privileges required (PR:N)
No account or special rights needed—anonymous or random user is enough.
User interaction (UI:N)
Nobody has to click “OK” or open a trap file; it can work without a victim helping.
Scope (S:C)
Breaking this can reach past the original component and bite other resources—bigger blast radius.
Confidentiality (C:H)
Serious risk that confidential data gets exposed in a big way.
Integrity (I:H)
They could widely tamper with or forge data—trust in the data is badly hurt.
Availability (A:H)
Could take the service down hard or make it unusable for people who depend on it.

Identifiers

CWEs

CWE id Name
CWE-200 Exposure of Sensitive Information to an Unauthorized Actor

Credits

  • webbertakken (coordinator)

Affected packages (1)

Vulnerable version ranges and first patched releases as published by GitHub.

Ecosystem Package Vulnerable range First patched Vulnerable functions
npm docusaurus-plugin-content-gists < 4.0.0 4.0.0

References

cvelogic Threat Intelligence