Skip to content
Leaked secrets Write-up Beginner

My First P1

A GitHub token with extensive administrative permissions was exposed in a publicly accessible script file. An attacker could use it to access private repositories and potentially perform administrative actions on the organisation.

medium.com

Published on medium.com

Last week, I decided to get iScan.today because I had seen so much positive feedback about it.

callgh0st, 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 token was hardcoded in a publicly accessible script, and it was over-privileged.

Impact

The token could allow reading private repositories and performing administrative actions on the organisation, though the report only demonstrates listing and cloning private repos.

What the attacker needed

Exposed GitHub token; token with broad permissions; network access to GitHub API

The fix

The token should be revoked and removed from the script, and tokens should follow the principle of least privilege.

How it was found

  1. Scan the target and receive an alert about an exposed GitHub token.
  2. Verify the token is active using a token-checking service.
  3. Query the GitHub API to list organisation repositories.
  4. Check the token's permissions via the API.
  5. List private repositories accessible with the token.
  6. Clone a private repository using the token and a discovered username.

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 access GitHub. Here, it was left in a file that anyone could read. Because the token had many permissions, someone who found it could read private code and possibly change things in the organisation's GitHub account.

What is Leaked secrets?

Keys, tokens or passwords left in public code, apps, logs or responses, that grant real access.

Similar reports

View all

Same bug class and techniques, clearest first.

Leaked secrets and credentials

The lesson behind this report.

Keys, tokens or passwords left in public code, apps, logs or responses, that grant real access.