Instagram GitHub Token with public_scope found In Travis CI Build Logs
A GitHub token with public_repo scope was exposed in Travis CI build logs for an Instagram repository. An attacker could use it to star repositories or perform other public actions on GitHub as the bot account.
Published on philippeharewood.com
In https://travis-ci.org/Instagram/IGListKit/ lists a Github token with publicscope, since this user is a member of the Instagram organization this might have undesirable effects.
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 CI configuration printed the token to build logs, and the token was intentionally given only public_repo scope as a trade-off to allow bot actions on pull requests.
Impact
The token could be used to perform public actions such as starring repositories or commenting on open-source projects, but its scope limited the impact to public resources.
What the attacker needed
Access to public Travis CI build logs; no authentication needed
The fix
The token should be kept secret and not printed in build logs, and its scope should be minimised.
How it was found
- Go to the Travis CI job page for the Instagram repository.
- Find the exported token in the build log.
- Check the token's scope using a GitHub API call.
- Use the token to star a repository as a test.
- Verify the star on the bot's GitHub profile.
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.
A GitHub token is like a password that lets a program act on GitHub. This token was accidentally shown in public build logs, so anyone could copy it and use it to do things like star repositories. The token only had permission to access public repositories, so the damage was limited.
What is Leaked secrets?
Keys, tokens or passwords left in public code, apps, logs or responses, that grant real access.