Skip to content
Leaked secrets Write-up Beginner

How I Discovered a High-Severity Information Disclosure via GitHu

A public GitHub repository exposed OAuth client credentials and an API key for an API service. An attacker could use these to obtain an access token, read developer personal data, and send unauthorised SMS messages.

Youssefhussein Follow

Published on medium.com

During one of my recent bug bounty hunts, I came across a high-severity information disclosure vulnerability using GitHub dorking. This vulnerability exposed sensitive developer information, including API secrets, client credentials, and mobile numbers.

Youssefhussein, 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 credentials were hardcoded in a public source code repository instead of being stored securely.

Impact

An attacker could authenticate to the API without authorisation, access developer personal information, and send arbitrary SMS messages, potentially causing spam, phishing, financial loss, and reputational damage.

What the attacker needed

Public GitHub repository with secrets; no authentication needed to search GitHub

The fix

The credentials should be revoked, secret scanning should be implemented, API key permissions should be restricted, credentials should be stored in environment variables, and API usage should be monitored.

How it was found

  1. Search GitHub for leaked credentials using a dorking tool.
  2. Find a public repository containing an API secret, client ID, client secret, and developer email.
  3. Use the leaked client ID and client secret to request an OAuth access token.
  4. Use the access token to call API endpoints and retrieve developer personal data.
  5. Use the exposed API key to send unauthorised SMS messages.

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 developer accidentally left secret passwords (called credentials) in a public code repository on GitHub. Anyone could find them and use them to log in to the company's API, read private information, and send text messages as if they were the company.

What is Leaked secrets?

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

More by Youssefhussein

View all

3 more disclosed reports, best first.

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.