Your RSA-2048 keys break in 2030. Find every one of them before attackers do.
🐹 Go

GHSA-pjp5-fpmr-3349

MEDIUM

GHSA-pjp5-fpmr-3349 is a medium-severity (CVSS 6) CWE-284 vulnerability in github.com/github/github-mcp-server. O3 Security confirms whether GHSA-pjp5-fpmr-3349 is actually reachable in your code before you act, and blocks exploitation at runtime until you patch.

GitHub MCP Server: Lockdown mode singleton in HTTP server causes cross-user GraphQL client confusion

Also known asCVE-2026-48529GO-2026-5779
Published
Jun 25, 2026
Updated
Jul 7, 2026
Affected
1 pkg
Patched
1 / 1
Exploits
None indexed

Blast Radius

1 pkg affected
🐹github.com/github/github-mcp-server

Real-time download stats are indexed for npm and PyPI packages. This vulnerability affects Go packages — download data is not available via public APIs for these ecosystems.

Description

Summary

When running in HTTP mode with --lockdown-mode enabled, the RepoAccessCache is implemented as a process-global singleton initialized with the first authenticated user's GraphQL client. All subsequent requests from different users share this singleton and their lockdown-related GraphQL queries are executed using the first user's credentials. The singleton is never updated to reflect later users' tokens.

Details

The singleton is defined in pkg/lockdown/lockdown.go:

var (
    instance   *RepoAccessCache
    instanceMu sync.Mutex
)

func GetInstance(client *githubv4.Client, opts ...RepoAccessOption) *RepoAccessCache {
    instanceMu.Lock()
    defer instanceMu.Unlock()
    if instance == nil {
        instance = &RepoAccessCache{
            client: client,  // only stored on first call
        }
    }
    return instance  // subsequent callers receive the same object regardless of their client
}

In HTTP mode, pkg/github/dependencies.go calls this per request:

func (d *RequestDeps) GetRepoAccessCache(ctx context.Context) (*lockdown.RepoAccessCache, error) {
    gqlClient, err := d.GetGQLClient(ctx)  // creates client with request's token
    ...
    instance := lockdown.GetInstance(gqlClient, d.RepoAccessOpts...)
    // gqlClient is silently dropped if singleton already exists
    return instance, nil
}

The singleton's internal client field is never updated after the first initialization. All lockdown GraphQL queries that check repository access and visibility (queryRepoAccessInfo, called by IsSafeContent) run under the first authenticated user's token for the lifetime of the process.

IsSafeContent is called in at least six places across pkg/github/issues.go and pkg/github/pullrequests.go to decide whether to trust or sanitize content from external contributors.

PoC

The following program demonstrates that two distinct GraphQL clients produce the same singleton pointer, confirming that the second client is discarded:

package main

import (
    "fmt"
    "net/http"
    "github.com/github/github-mcp-server/pkg/lockdown"
    "github.com/shurcooL/githubv4"
)

func main() {
    httpClientA := &http.Client{}
    httpClientB := &http.Client{}
    gqlClientA := githubv4.NewEnterpriseClient("https://api.github.com/graphql", httpClientA)
    gqlClientB := githubv4.NewEnterpriseClient("https://api.github.com/graphql", httpClientB)

    fmt.Printf("gqlClientA (user A token): %p\n", gqlClientA)
    fmt.Printf("gqlClientB (user B token): %p\n", gqlClientB)
    fmt.Printf("clients are different objects: %v\n\n", gqlClientA != gqlClientB)

    instanceForA := lockdown.GetInstance(gqlClientA)
    instanceForB := lockdown.GetInstance(gqlClientB)

    fmt.Printf("lockdown instance returned for user A: %p\n", instanceForA)
    fmt.Printf("lockdown instance returned for user B: %p\n", instanceForB)
    fmt.Printf("same singleton returned for both users: %v\n", instanceForA == instanceForB)
}

Output:

gqlClientA (user A token): 0x400044070
gqlClientB (user B token): 0x400044078
clients are different objects: true

lockdown instance returned for user A: 0x400002ecc0
lockdown instance returned for user B: 0x400002ecc0
same singleton returned for both users: true
<img width="1642" height="450" alt="image" src="https://github.com/user-attachments/assets/bec46420-9ba7-458e-8710-62f951cb836a" />

Impact

This affects deployments running the HTTP server with --lockdown-mode, which is the intended configuration for multi-user scenarios such as GitHub Copilot's managed MCP endpoint.

Three concrete consequences:

First, the ViewerLogin field in cache entries always reflects the first authenticated user's identity. The IsSafeContent check repoInfo.ViewerLogin == strings.ToLower(username) compares this stale value against each subsequent user's login, producing incorrect results for all users except the first.

Second, repository visibility and collaborator access data stored in the cache is evaluated through the first user's token. If user A cannot see a private repository but user B can (or vice versa), the cached isPrivate and hasPushAccess values will reflect user A's view of that repository, causing IsSafeContent to return wrong decisions for user B. In lockdown mode, a wrong true result means potentially injected content from untrusted external contributors is passed to the model without sanitization.

Third, if the first user's token is revoked or expires, all subsequent lockdown GraphQL queries fail with authentication errors. Since getRepoAccessInfo propagates these errors, IsSafeContent returns an error for every request, breaking lockdown protection for all users until the process is restarted.

Affected Packages

1 total 1 fixed
EcosystemPackageVulnerable rangeFix
🐹Gogithub.com/github/github-mcp-server0.22.0&&< 1.1.21.1.2

Detection & mitigation playbook

Open-source dependency
  1. Detect

    Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for github.com/github/github-mcp-server. O3's reachability analysis confirms whether the vulnerable code path is actually invoked in your application, so you act on real exposure instead of every transitive match.

  2. Fix

    Update github.com/github/github-mcp-server to 1.1.2 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-pjp5-fpmr-3349 is resolved across your whole dependency graph.

  3. Workarounds

    If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.

  4. How O3 protects you

    O3 pinpoints whether GHSA-pjp5-fpmr-3349 is reachable in your code and exactly where to fix it, then blocks exploitation in production at runtime until the patched version is deployed.

Tailored to GHSA-pjp5-fpmr-3349. Runtime protection reduces exposure until a permanent patch is applied and verified — it complements patching, it doesn't replace it.

Frequently Asked Questions

### Summary When running in HTTP mode with --lockdown-mode enabled, the RepoAccessCache is implemented as a process-global singleton initialized with the first authenticated user's GraphQL client. All subsequent requests from different users share this singleton and their lockdown-related GraphQL queries are executed using the first user's credentials. The singleton is never updated to reflect later users' tokens. ### Details The singleton is defined in pkg/lockdown/lockdown.go: ```go var ( instance *RepoAccessCache instanceMu sync.Mutex ) func GetInstance(client *githubv4.Clien
O3 Security · Impact-Aware SCA

Is GHSA-pjp5-fpmr-3349 in your dependencies?

O3 detects GHSA-pjp5-fpmr-3349 across Go dependencies and uses function-level reachability to confirm whether the vulnerable code path is actually reachable — not just present. No false positives.