Skip to content
RCE Write-up Advanced

One Delimiter Too Many: The $100,000 GitHub Bug Hiding in git push

User-supplied git push option values were copied unsanitised into internal metadata that used a delimiter also allowed in user input, letting an authenticated user inject extra fields. Because downstream services trusted the metadata and parsing was last-write-wins, an attacker could override sandbox settings and, chained with a path traversal in hook locations, achieve command execution on shared storage infrastructure.

T4nv1 Follow

Published on medium.com

Most people think of git push as sending commits. Underneath, a push is a conversation with a fleet of internal services: something terminates the connection, something checks permissions, something stores the objects, and something runs hooks, small programs that fire before or after a push is accepted (a pre-receive…

T4nv1, on medium.com

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

Likely the root cause was that user-controlled push option values were concatenated into an internal metadata format whose field delimiter could also appear in user input, and downstream services trusted the resulting fields without re-validating them.

Impact

An authenticated user with push access could achieve command execution as the git service user; on github.com this put other users' and organisations' repositories within reach on shared storage nodes, and on GHES a single push could mean full server compromise, though GitHub found no evidence of abuse and the researchers accessed only their own test accounts.

What the attacker needed

An authenticated GitHub account; push access to a repository (can be your own)

The fix

GitHub sanitised push option values so they can no longer affect internal metadata fields, patched all supported GHES versions, and removed an unneeded code path from the container image as defence in depth.

How it was found

  1. Authenticate to GitHub and have push access to a repository, including one you create yourself.
  2. Attach a crafted push option to a git push so its value contains the metadata delimiter and extra fields.
  3. The server copies the push option value into internal metadata, and the injected fields override legitimate settings because parsing is last-write-wins.
  4. Override the setting that controls whether hooks are sandboxed, then redirect where hooks are loaded from using a path traversal in the hook location handling.
  5. Point at a crafted hook entry so the git service user executes commands.

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 passes a small note about your push between its own internal programs. The bug was that this note included text you control, and the server did not clean it, so you could sneak extra instructions into the note. The server's internal programs trusted the note completely, so those extra instructions could change how the server ran its checks and, in the end, let the attacker run commands on the server.

What is RCE?

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

More by T4nv1

View all

113 more disclosed reports, best first.

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.