Enterprise ServerApplication · GitHub

CVE-2021-22864

HIGH · 8.8 CVSS v3.1 Published 2021-03-23
Fix available
A fix is available. Upgrade to 2.21.17 / 2.22.9 or later.
See remediation →
94/100
Remediation priority · Urgent
Remotely reachable Zero-click

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 · unedited
A 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 confidence

Remote 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.

MitigationUpgrade 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.

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
Enterprise ServerApplication
Affected:>= 2.21.0, < 2.21.17>= 2.22.0, < 2.22.9>= 3.0.0, < 3.0.3

CVSS 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 checks

Work through these to decide whether this CVE applies to you.

  1. Identify the installed GitHub Enterprise Server version
    Access 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
  2. Confirm the GitHub Pages feature is enabled
    Log 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)
  3. Audit GitHub Pages site creation permissions
    In 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)
  4. Check for suspicious Pages site configurations or build workflows
    Review 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.

Check your environment

Paste your version and any relevant configuration and it will be compared against the affected criteria above. Do not include secrets or credentials.

AI-assisted, checked against the advisory. Informational, not a guarantee.

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 · scoped
Upgrade available Upgrade to 2.21.17 / 2.22.9 / 3.0.3 or later
Fixed in 2.21.172.22.93.0.3
Interim mitigation

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.

Recommended fix High confidence

Upgrade to GitHub Enterprise Server 3.0.3, 2.22.9, or 2.21.17 (whichever is compatible with your deployment track)

  1. 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
  2. Ensure you have a complete backup of your GitHub Enterprise Server instance data
  3. Download the appropriate upgrade package for your target version from the GitHub Enterprise downloads page
  4. Follow the official upgrade instructions for your deployment method (HMAC or ISO)
  5. Run the upgrade procedure according to GitHub's documentation
  6. After upgrade completes, verify the GitHub Enterprise Server version matches the expected fixed version
  7. Confirm GitHub Pages functionality is working correctly post-upgrade
Caveat Review release notes for your upgrade path as there may be functionality changes between versions; ensure you are following the correct upgrade sequence for your current version

Generated from the published advisory — verify against the referenced sources before acting.

Fix this in Enterprise Server Scoped from the published advisory
  • Consultation6.0 h
  • Implementation12.0 h
  • Testing8.0 h
  • Review / QA4.0 h
30.0 hours of engineering $5,280
Get the upgrade done

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 locally
dbcve dependency scanner

Check 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 sources

Practitioner notes

Contributed

Peer-ranked notes from engineers who’ve handled CVE-2021-22864 in production — separate from our analysis above.

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.

What this is

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.

What belongs here
  • 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