CVE-2021-22864
Official description Straight from the sourceThe vendor's or NVD's own wording, published unedited. Authoritative, but often terse — it says what broke, rarely what to do.
NVD · uneditedA remote code execution vulnerability was identified in GitHub Enterprise Server that could be exploited when building a GitHub Pages site. User-controlled configuration options used by GitHub Pages were not sufficiently restricted and made it possible to override environment variables leading to code execution on the GitHub Enterprise Server instance. To exploit this vulnerability, an attacker would need permission to create and build a GitHub Pages site on the GitHub Enterprise Server instance. This vulnerability affected all versions of GitHub Enterprise Server prior to 3.0.3 and was fixed in 3.0.3, 2.22.9, and 2.21.17. This vulnerability was reported via the GitHub Bug Bounty program.
Technical summary Written by usOur analysis, written from the advisory, the CVSS vector and the affected-version data. It adds context the advisory leaves out, and never invents facts that are not in the source.
dbcve analysis · high confidenceRemote code execution vulnerability in GitHub Enterprise Server's GitHub Pages feature where insufficient restrictions on user-controlled configuration options allowed environment variable override, enabling code execution on the server instance. Attack requires authenticated permission to create/build GitHub Pages sites.
Verify against the referenced sources before acting — the references below are authoritative for this CVE, this summary is not.
Affected products & versions What the vendor confirmedThe version ranges the vendor confirmed as vulnerable. If your version sits inside a range here, treat yourself as exposed until you have upgraded.
NVD · CPE data>= 2.21.0, < 2.21.17>= 2.22.0, < 2.22.9>= 3.0.0, < 3.0.3CVSS breakdown How the score is builtThe industry scoring standard. It rates how the flaw is reached, what it takes to exploit, and what an attacker gains — the score is derived from those, not the other way round.
From the vector- Attack vector
- Network
- Complexity
- Low
- Privileges
- Low
- User interaction
- None
- Scope
- Unchanged
- Confidentiality
- High
- Integrity
- High
- Availability
- High
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
Am I affected? How to checkSteps we derive from the advisory and the affected-version data, so you can decide whether this CVE reaches your setup. They are a guide, not a scan — your own configuration is the authority.
dbcve checksWork through these to decide whether this CVE applies to you.
-
Identify the installed GitHub Enterprise Server versionAccess the GitHub Enterprise Server admin console and navigate to the 'Site admin' dashboard, or run the command `ghe-version` from the management shell. The version number is displayed on the initial admin console login page.Affected if The installed version falls within any of these ranges: 2.21.0 through 2.21.16, 2.22.0 through 2.22.8, or 3.0.0 through 3.0.2
-
Confirm the GitHub Pages feature is enabledLog into the GitHub Enterprise Server admin console, go to 'Site admin' > 'Settings' > 'Pages', or check the management shell command `ghe-app-info -p` to see enabled features.Affected if GitHub Pages is turned on for the instance (the vulnerability only applies when Pages is enabled)
-
Audit GitHub Pages site creation permissionsIn the site admin console, navigate to 'Site admin' > 'Organization settings' > 'Repository' and review who has the 'Pages' permission or the ability to create repositories with Pages enabled. Alternatively, query the GitHub Enterprise API or database for users with 'repo' or 'pages' permissions.Affected if Any user other than strictly limited admins can create or build GitHub Pages sites (the attack requires authenticated permission to create Pages sites)
-
Check for suspicious Pages site configurations or build workflowsReview recent GitHub Pages site builds via the management shell using `ghe-repos --pages` or by inspecting `.github/workflows` files in repositories that have Pages enabled for unusual environment variable settings or shell command injection patterns.Affected if Any Pages site configurations show overridden environment variables or unexpected build commands that were not authored by known administrators
You are affected if your GitHub Enterprise Server version is 2.21.x before 2.21.17, 2.22.x before 2.22.9, or 3.0.x before 3.0.3, AND the GitHub Pages feature is enabled, AND users with Pages creation permissions exist on the instance.
Generated from the published advisory. Verify against your own configuration.
Remediation Closing itWhat it takes to close this. Where a vendor fix exists we point at it; where none exists we say so plainly, and can build one. Effort estimates are scoped from the advisory, not from your codebase.
dbcve · scoped2.21.172.22.93.0.3
Upgrade GitHub Enterprise Server to version 3.0.3, 2.22.9, or 2.21.17 (or later) to patch the vulnerability. Additionally, restrict or audit GitHub Pages site creation permissions until upgrade is complete.
Upgrade to GitHub Enterprise Server 3.0.3, 2.22.9, or 2.21.17 (whichever is compatible with your deployment track)
- Review the GitHub Enterprise Server release notes for your target upgrade version (3.0.3, 2.22.9, or 2.21.17) to understand changes and prerequisites
- Ensure you have a complete backup of your GitHub Enterprise Server instance data
- Download the appropriate upgrade package for your target version from the GitHub Enterprise downloads page
- Follow the official upgrade instructions for your deployment method (HMAC or ISO)
- Run the upgrade procedure according to GitHub's documentation
- After upgrade completes, verify the GitHub Enterprise Server version matches the expected fixed version
- Confirm GitHub Pages functionality is working correctly post-upgrade
Generated from the published advisory — verify against the referenced sources before acting.
- Consultation6.0 h
- Implementation12.0 h
- Testing8.0 h
- Review / QA4.0 h
An estimate, not a bill — we confirm scope with you before any work starts. Need it this week? Rush from $8,448.
Scan for this in your stack
Free · runs locallyCheck whether your project pulls in CVE-2021-22864 — or any other known-vulnerable package — straight from your lock files. Free and open source; it runs locally and uploads nothing.
References Go to the primary sourcePrimary sources — vendor advisories, patches and trackers. Where our summary and a reference disagree, the reference wins.
Primary sourcesPractitioner notes
ContributedPeer-ranked notes from engineers who’ve handled CVE-2021-22864 in production — separate from our analysis above.
The advisory tells you what broke. It rarely tells you what actually worked. If you’ve dealt with this one, that detail is what the next engineer is searching for.
- The version that genuinely resolved it — not the one the vendor claimed
- A config change or rule that shut the vector down
- A gotcha in the upgrade path that cost you an afternoon
No notes yet
Be the first to add a field note for this CVE — a mitigation you’ve verified, a version caveat, or a link to a working fix. Sign in above to contribute.
A place for practitioners to share what actually worked: a mitigation you’ve tested, a configuration change, a version- or environment-specific caveat, or a link to a verified patch. The most useful notes rise to the top as peers upvote them, so the signal stays high.
- Verified mitigations, workarounds, and config changes
- Version or environment caveats, and links to real fixes
- No weaponised exploit code, or anything meant to cause harm
- No spam, self-promotion, credentials, or personal data