Skip to content
RCE Write-up Advanced

Securing the Git push pipeline: Responding to a critical remote code execution

A vulnerability in how GitHub handled user-supplied git push options allowed an attacker with push access to inject additional fields into internal metadata, bypass sandboxing, and execute arbitrary commands on the server. The flaw was fixed on github.com within hours, and no exploitation was found.

github.blog

Published on github.blog

Alexis Wales·@alexiswales

Alexis Wales, on github.blog

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

User-supplied push option values were incorporated into internal metadata without sufficient sanitization, and the delimiter used in that metadata could also appear in user input, allowing injection of additional fields.

Impact

An attacker with push access could execute arbitrary commands on the GitHub server, but the text states there was no exploitation and no customer data was accessed.

What the attacker needed

Push access to a repository

The fix

The vulnerability was fixed by properly sanitizing user-supplied push option values and removing an unnecessary code path from the server environment.

How it was found

  1. Create a repository or have push access to one.
  2. Run a git push command with a crafted push option that includes an unsanitized character.
  3. The server processes the push option and injects additional fields into internal metadata.
  4. The injected fields override the environment and bypass sandboxing, leading to arbitrary command execution.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

When you push code to GitHub, the server processes information about your push. This report found that a special option you can include with your push could trick the server into running commands it shouldn't. The problem was fixed quickly, and no one had abused it.

What is RCE?

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.

Similar reports

View all

Same bug class and techniques, clearest first.

Remote code execution

The lesson behind this report.

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.