Skip to content
Misconfiguration Write-up Beginner

The Curious Case of GitHub Commit Spoofing: A Lighthearted Exploration

Git commits on GitHub can be made to appear as if authored by another user by setting the local Git user.name and user.email to that person's details. An attacker could use this to impersonate a maintainer and potentially get malicious changes merged.

Shani Lavi Follow

Published on infosecwriteups.com

Picture this: you’re sipping your coffee, casually committing your latest code changes to GitHub, when suddenly you realize your commit is credited to Linus Torvalds. Sounds like a coder’s dream, right?

Shani Lavi (Developer & Researcher @ UNIXi), on infosecwriteups.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

Git commit author metadata is not authenticated by GitHub, so it can be set arbitrarily by the committer.

Impact

An attacker could impersonate a trusted maintainer to introduce harmful code or mislead contributors, though GitHub states this does not grant unauthorised access or privileges.

What the attacker needed

Git CLI installed; Access to a repository to push to; Knowledge of target user's name and email

The fix

GitHub should encourage or enforce commit signature verification and vigilant mode to make impersonation detectable.

How it was found

  1. Install Git CLI and clone the target repository.
  2. Find a target commit and copy its hash.
  3. View the commit metadata to get the username and email.
  4. Configure Git with the target user's name and email.
  5. Make changes, commit, and push to the target branch.
  6. Check GitHub to see the commit displayed as the target user.

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 make a Git commit, your name and email are stored in the commit details. GitHub displays these details as the author, without checking if you really are that person. So anyone can pretend to be someone else by changing their Git settings.

What is Misconfiguration?

Settings left unsafe: exposed panels, open storage buckets, debug modes, default credentials.

Similar reports

View all

Same bug class and techniques, clearest first.

Security misconfiguration

The lesson behind this report.

Settings left unsafe: exposed panels, open storage buckets, debug modes, default credentials.