How I Earned $8947 bounty for Remote Code Execution via a Hijacke
A public GitHub repository referenced an unclaimed GitHub account in its Go module path, allowing anyone to register that account and supply code. An attacker could then have their code fetched and executed when the project was built, leading to remote code execution.
Published on infosecwriteups.com
Earlier this year, I discovered a High severity Remote Code Execution (RCE) vulnerability affecting a big company (referred to as Redacted for confidentiality). Through a combination of my reconnaissance tool and quick action, I was able to demonstrate a full RCE scenario — and was awarded $8947 for the finding.
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 project's Go module path referenced a GitHub account that was not controlled by the organisation, allowing an attacker to register it and supply malicious code.
Impact
Because Go's module system automatically fetches code from GitHub, building the affected repositories could have led to code execution on the company's infrastructure, with potential supply chain compromise and production server breach.
What the attacker needed
Public GitHub repositories with go.mod references; the referenced GitHub account is unclaimed; the project is built or deployed
The fix
The company removed references to the hijacked GitHub account, and the account was transferred back to the company; the report also suggested vendoring dependencies.
How it was found
- Review public GitHub repositories and notice references to a third-party GitHub account in Go module files.
- Check the referenced GitHub account and find it is unclaimed.
- Register the unclaimed GitHub account.
- Create a repository matching the expected Go module path.
- Upload a proof-of-concept Go file that executes remote code.
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 software is built, it often downloads other pieces of code from the internet. If the address of that code points to an account nobody owns, someone else can take that account and put their own harmful code there. Then, when the software is built, the harmful code runs on the victim's computer.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.