/

CVE-2026-48501

Severity:

HIGH RISK

(7.4)

Improper Authorization / Access Control in GitHub CLI TUF

CVE-2026-48501

Analyzed

Vulnerability type

Category:

Improper Authorization / Access Control

CWE:

CWE-863

Impact:

Credential / Token Exposure to Unintended Third-Party Services

Severity:

HIGH RISK

(7.4)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

GitHub CLI (gh) versions prior to 2.93.0 may send GitHub access tokens in Authorization headers to unintended third‑party hosts when using attestation and release verification commands.

Because the CLI's shared HTTP client misidentifies request targets and over-applies authentication, tokens intended only for github.com or GHES instances can leak to TUF mirrors and other external services during normal command execution.

Affected context

This issue affects environments where:

  • GitHub CLI (gh) is used below version 2.93.0, and
  • Users run gh attestation, gh release verify, or gh release verify-asset, and
  • The CLI is configured with GitHub.com or GitHub Enterprise Server (GHES) tokens (e.g., GITHUB_TOKEN, GH_TOKEN, GH_ENTERPRISE_TOKEN).

The vulnerability is triggered when these commands fetch TUF metadata or artifacts from non-API hosts (such as tuf-repo.github.com, tuf-repo-cdn.sigstore.dev, or Azure Blob Storage endpoints) via the shared authenticated HTTP client.

Exploit preconditions

  • Attack surface: Outgoing HTTPS requests from GitHub CLI to:
  • tuf-repo.github.com (GitHub Pages site)
  • tuf-repo-cdn.sigstore.dev
  • Azure Blob Storage artifact endpoints
  • Required access: An attacker would need control or visibility over one of these endpoints' traffic or logs, or control a similar host that receives requests from the CLI.
  • Trigger point: Execution of:
  • gh attestation
  • gh release verify
  • gh release verify-asset

in a context where GitHub tokens are configured.

  • Why exploitation is possible: The authentication layer:
  • Uses a shared HTTP client for both GitHub API and external hosts.
  • Normalizes hostnames such that any *.github.com is treated as github.com.
  • Falls back to GH_ENTERPRISE_TOKEN for hosts that are not recognized as GitHub.com or a configured GHES instance.

This causes Authorization headers containing tokens to be attached to requests that are not destined for the intended GitHub API or GHES hosts.

Why this happens

The underlying problem is an improper authorization propagation pattern in the HTTP client design.

Instead of strictly scoping credentials to a narrow set of known API hosts, the client:

  • Shares a single authenticated HTTP layer across both trusted and untrusted destinations, and
  • Implements permissive host normalization logic that conflates *.github.com with github.com.

This behavior maps to CWE-863: Improper Authorization because the system applies valid credentials in a broader security context than intended, granting external services access to sensitive tokens that should only be presented to GitHub.com or explicitly configured GHES hosts.

Conceptually, this is an access-control boundary failure: the authorization mechanism does not correctly distinguish between "who should receive this credential" and "who is merely being contacted over HTTP."

Potential impact

  • Exposure of GitHub access tokens to TUF mirror hosts and other external infrastructure.
  • Potential misuse of leaked tokens to:
  • Access private repositories or organization resources.
  • Read or modify issues, pull requests, or release artifacts, depending on token scope.
  • Elevated risk of supply-chain attacks if a compromised token is used to tamper with release assets, tags, or provenance data.
  • Unauthorized access to GitHub Enterprise Server instances when GH_ENTERPRISE_TOKEN is inadvertently sent to unrelated hosts.
  • Long-lived credential leakage into third-party logs, telemetry systems, or backups, increasing the window of abuse.

General mitigation guidance

Effective mitigation focuses on tightening credential scoping and segregating authentication from generic HTTP traffic:

  • Use separate HTTP clients or middleware for:
  • Authenticated GitHub.com / GHES API calls, and
  • Anonymous or public third-party endpoints (e.g., TUF mirrors, CDNs, storage).
  • Implement strict host allowlists for attaching Authorization headers:
  • Only send GitHub.com tokens to github.com and well-defined API subdomains.
  • Only send GHES tokens to explicitly configured enterprise domains.
  • Avoid broad host normalization:
  • Do not collapse *.github.com to github.com; treat each hostname explicitly.
  • Prefer exact host matching or carefully defined patterns over generic suffix checks.
  • Reduce token privileges and exposure:
  • Encourage the use of least-privilege tokens scoped to specific operations.
  • Prefer short-lived tokens where feasible to minimize impact if leaked.
  • Design CLI workflows so that:
  • Third-party verification and metadata retrieval paths default to no authentication.
  • Any future need to authenticate to external infrastructure uses separate, clearly scoped credentials.

How teams detect issues like this

Organizations can look for this class of issue using a mix of code-centric and operational techniques:

  • Static analysis and code scanning:
  • Flag uses of shared HTTP clients that automatically attach Authorization headers without explicit host checks.
  • Detect host normalization logic that:
  • Collapses subdomains to parent domains in authentication layers.
  • Applies tokens based on loose substring or suffix matching.
  • Code review practices:
  • Review CLI/network tooling to ensure credentials are bound to explicit host allowlists.
  • Require that any new integration with third-party endpoints goes through an unauthenticated client by default.
  • Check for fallbacks that apply enterprise tokens (GH_ENTERPRISE_TOKEN-like) to unknown hosts.
  • Runtime and operational monitoring:
  • Inspect outbound HTTP logs (e.g., via proxies) for Authorization headers being sent to non-GitHub / non-GHES domains.
  • Use network egress controls to restrict sensitive credential use to known destinations.
  • Automated policy enforcement:
  • Integrate custom linters or security policies into CI to block changes that introduce generalized "auto-auth" behavior to shared HTTP layers.

Sources

SourceLink
github.comgithub.com/cli/cli/security/advisories/GHSA-8xvp-7hj6-mcj9

Frequently asked

questions

An attacker cannot directly trigger the leak over the network alone; the user (or an automated workflow) must run affected GitHub CLI commands. However, any party that controls or can observe traffic to TUF mirrors or other external endpoints involved in these workflows could obtain tokens that are mistakenly sent.

The impact depends entirely on the token's scopes and associated account or organization. A compromised token may allow reading private repositories, modifying code, changing releases, or even organization-level administration if it is overly privileged. Least-privilege, short-lived tokens significantly reduce the potential blast radius.

Use separate HTTP clients for authenticated and unauthenticated traffic, and strictly bind credentials to a small, explicit set of hosts. Avoid automatic authentication for generic HTTP requests, and ensure any hostname normalization logic cannot broaden the set of hosts that receive credentials beyond what is explicitly intended.

Treat credential propagation as an explicit operation rather than a convenience feature. During design, define clear trust boundaries: which hosts may receive which tokens, and under what circumstances. During review, scrutinize any "auto-attach token" behavior, verify strict host allowlists, and ensure that third-party integrations default to no authentication unless there is a carefully justified need with dedicated, separately scoped credentials.

Find out what's already
exploitable in your codebase.