I Was Treating Header Injection as Low-Impact.
A git push option value was copied verbatim into an internal header that downstream services parsed by splitting on semicolons, letting a user inject extra fields. By overriding fields that control sandboxing and hook paths, an attacker could run arbitrary code as the git service user on GitHub Enterprise Server and, after injecting one more flag, on GitHub.com.
medium.com
Published on medium.com
You send a request, add a \r\n, and boom — your input shows up as a new header. Or you throw a ; in a value and suddenly there's a second key-value pair staring back at you.
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 push option value was concatenated into a semicolon-delimited internal header without encoding, and the downstream parser used last-write-wins, so injected keys silently overrode trusted ones.
Impact
An attacker could run arbitrary code as the git service user, potentially reaching every repository and secret on the storage node, though the researchers only validated with their own test accounts.
What the attacker needed
Ability to push to a repository; push option support on the server
The fix
GitHub fixed it by percent-encoding semicolons at the boundary and removed the unnecessary production code path.
How it was found
- Push to a repository with a push option whose value contains a semicolon and a field assignment.
- The git proxy copies the option into the internal header, and the downstream parser splits it into extra fields.
- Inject a value that changes the environment away from production, removing the sandbox.
- Inject a custom hooks directory and a hook definition whose script path traverses to a chosen binary.
- On GitHub.com, also inject the enterprise-mode flag so the custom hooks path is reached.
- The hook runs the chosen binary as the git user, confirming code 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 one program passes data to another, it often packs several values into one long line, separated by a character such as a semicolon. If a user's text is dropped into that line without cleaning, the user can add their own semicolons and fake extra values. Here the fake values changed security settings, so the server ended up running the attacker's chosen program.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.