Skip to content
Info disclosure Write-up Beginner

Exposed API Keys & Config Files in js file! || Bug Bounty

JavaScript files exposed on a target contained sensitive API keys and system configurations. An attacker could use these exposed secrets to access protected services or systems.

medium.com

Published on medium.com

During hunting on target I found sensitive API keys and system configurations How could I find that?

Kerolos Ayman, 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, JavaScript files were deployed with hardcoded secrets or configuration details that should have been kept server-side.

What the attacker needed

Publicly accessible JavaScript files; Recon tools to collect URLs

How it was found

  1. Collect subdomains using sublist3r, subfinder, assetfinder, amass, and check alive with httpx.
  2. Fetch known URLs for the domain using waybackurls and gau.
  3. Filter the URL lists to keep only .js files.
  4. Run Mantra and Jsecret on the collected JavaScript files to extract secrets.
  5. Manually review the tool outputs to discard false positives.

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.

JavaScript files that websites send to browsers can accidentally include secret keys or settings. If these files are publicly accessible, anyone can read them and use the secrets to break in. This report shows how a hunter found such files and extracted the secrets.

What is Info disclosure?

Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.

Similar reports

View all

Same bug class and techniques, clearest first.

Information disclosure

The lesson behind this report.

Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.