Skip to content
Info disclosure Write-up Intermediate

️‍♂️ Forgotten But Dangerous: How an Old Staging Domain Handed Me Production Secrets

A forgotten staging subdomain exposed a debug script revealing an internal API endpoint with public Swagger documentation. A misconfigured endpoint allowed retrieval of production secrets, including a live API key, which was then used to export production user data.

iski Follow

Published on medium.com

Free link 🎈

Iski, 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 a combination of an exposed staging environment with debug mode enabled, publicly accessible API documentation, and an endpoint that failed to restrict access to production configuration.

Impact

The leak exposed production user data including password hashes, live API keys, and partial SSNs, and the stolen API key could allow full account takeover for any user.

What the attacker needed

Internet access; Knowledge of subdomain enumeration

The fix

The text does not state that the issue was fixed; it should be fixed by removing debug mode, restricting API documentation, isolating staging from production, and applying least privilege to API keys.

How it was found

  1. Found a forgotten staging subdomain through mass reconnaissance.
  2. Accessed the staging site and viewed page source, finding a debug script.
  3. Opened browser developer tools console and saw a debug message revealing an internal API endpoint.
  4. Visited the API endpoint and found exposed Swagger UI documentation.
  5. Called the /api/config/{environment} endpoint with 'production' to retrieve production secrets.
  6. Used the leaked live API key to authenticate and call an admin data export endpoint, retrieving production user data.

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.

An old staging website, meant for testing, was left online and had debugging turned on. This revealed an internal API with documentation that showed how to get configuration details. A flaw in one endpoint let the attacker ask for production settings instead of staging ones, leaking a powerful key that unlocked user data.

What is Info disclosure?

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

More by iski

View all

186 more disclosed reports, best first.

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.