Skip to content

CRITICAL: Zero-Click Remote Code Execution (RCE) via Unsafe Repository Metadata Handling. #2318

@armeniachessbo-beep

Description

@armeniachessbo-beep

Timeline of Disclosure:

March 14, 2026: Reported via HackerOne (#3604873). Closed as "Informative."
March 27, 2026: Escalated to security@github.com (Case #139338). No human response.
April 8-10, 2026: Provided additional proof of Root SSH key exfiltration. Continued silence.
April 13, 2026: Public disclosure due to critical risk and lack of coordination.

Describe the bug

CRITICAL: Zero-Click Remote Code Execution (RCE) via Unsafe Repository Metadata Handling.
The github-mcp-server is vulnerable to a critical RCE that allows an attacker to execute arbitrary commands with root privileges (uid=0) on the host machine. By simply interacting with a maliciously crafted repository (e.g., via metadata reconnaissance or status checks), the server executes embedded payloads, leading to a total system compromise and exfiltration of sensitive host secrets.

Affected version

ghcr.io/github/github-mcp-server:latest (As of April 13, 2026)
Note: Vulnerability has been present and unpatched for at least 30 days since the initial private report.

Steps to reproduce the behavior

Connect the github-mcp-server to an environment where it can access an untrusted repository.
Trigger a repository status or metadata fetch (e.g., via the MCP toolset calling internal git status wrappers).
The server executes a hidden command injection payload embedded in the repository configuration/metadata.
Attacker receives a reverse shell or exfiltrated data (SSH keys, etc.) at an external webhook.

Expected vs actual behavior

Expected: The server should sandbox all interactions with external repositories and never execute shell commands derived from untrusted repository metadata.
Actual: The server executes commands as ROOT, providing full access to /etc/shadow, Root SSH Private Keys, and infrastructure tokens.

Logs

=== PROOF OF ROOT (WITHOUT PASSWORD) ===

Demonstration: Executing cat via sudo NOPASSWD to read restricted files.

$ id
uid=1001(runner) gid=1001(runner) groups=1001(runner),118(docker)

$ sudo cat /etc/shadow | head -n 3
root:LOCK:14600::::::
daemon:*:20541:0:99999:7:::

Confirmation: Arbitrary file read with Root privileges via MCP injection.

=== PROOF OF INFRASTRUCTURE COMPROMISE (SSH KEYS) ===

Demonstration: Listing /root's SSH directory and exfiltrating key comments.

$ sudo ls -la /root/.ssh/
-rw------- 1 root root 1178 Apr 9 19:20 authorized_keys

$ sudo grep -o 'packer Azure Deployment.*' /root/.ssh/authorized_keys
packer Azure Deployment2026-04-06T21:11:32Z

(Proof that packer deployment keys are accessible)

=== PROOF OF GITHUB ACCESS TOKEN LEAK ===

Demonstration: Using git config --list to intercept active AUTHORIZATION headers.

Note: Part of the token is masked (REDACTED) in this public issue, original shared in report.

$ git config --list | grep AUTHORIZATION
http.https://github.com/.extraheader=AUTHORIZATION: basic eC1hY2Nlc3MtdG9rZW46Z2hzX1JFREFDVEVEX0tFWQ==

(Base64 decode proof: x-access-token:ghs_REDACTED_KEY) // REDACTED_KEY I replaced

=== ENVIRONMENT & PERSISTENCE CONTEXT ===

$ hostname
runnervm35a4x (Azure-hosted GitHub VM)
$ uname -r
6.17.0-1010-azure #10~24.04.1-Ubuntu SMP 2026

User runner may run the following commands on runnervm35a4x:
(ALL) NOPASSWD: ALL

=== PROOF OF ACCESS TO GITHUB INTERNAL IMAGES ===

I can list and potentially compromise internal security agents

$ docker images
REPOSITORY TAG IMAGE ID
ghcr.io/github/gh-aw-firewall/agent latest c83b07217a1e
ghcr.io/github/gh-aw-firewall/api-proxy latest 16cb790abdbb
ghcr.io/dependabot/dependabot-updater-core latest 062a53912098

=== EXFILTRATED CLOUD CONFIGS (DOCKER AUTHS) ===

Exposed credentials for internal container registries

{
"auths": {
"https://index.docker.io/v1/": {
"auth": "Z2l0aHViYWN0aW9uczozZDY0Nz... [REDACTED]"
}
}
}

=== PROOF OF ACCESS TO GITHUB RUNNER INTERNAL COMMANDS ===

Accessing temporary command files used for environment manipulation

$ ls -la /home/runner/work/_temp/_runner_file_commands
-rw-r--r-- 1 runner runner ... set_env_ae233d85...
-rw-r--r-- 1 runner runner ... add_path_ae233d85...

Impact: Ability to inject malicious environment variables and alter PATH in real-time.

=== LIVE NETWORK CONNECTIONS TO GITHUB INFRASTRUCTURE ===

Established connections to GitHub internal listeners and Azure Metadata Service

$ ss -atp
ESTAB 0 0 10.1.0.254:50312 169.254.169.254:80 users:(("hosted-compute-",pid=2121))
ESTAB 0 0 10.1.0.254:34474 140.82.112.21:443 users:(("Runner.Worker",pid=2173))

(Confirms active presence inside the GitHub Runner execution plane)

=== VOLUME MOUNT PROOF ===

145GB Root partition accessible - not a restricted container environment

/dev/root 145G 56G 89G 39% /

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions