Behind the Scenes: How Pre-Prod Leaks Led Me to Prod Secrets
A pre-production admin panel was accessible with default credentials and exposed production database credentials and a JWT secret. An attacker could use these secrets to access production data and escalate privileges.
medium.com
Published on medium.com
Free Link ๐
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 pre-production environment was not isolated from production and used weak default credentials, exposing sensitive secrets.
Impact
The exposed secrets could allow full access to production databases, user data, and cloud storage, with no logging or alerts to detect the activity.
What the attacker needed
Access to pre-prod endpoints; default credentials work; no network restrictions
The fix
Pre-production environments should be isolated from production, use strong unique credentials, and secrets should be managed securely rather than hardcoded.
How it was found
- Found staging and pre-production endpoints via subdomain enumeration and Google dorking.
- Logged into the pre-production admin panel using default credentials.
- Observed that the panel displayed production environment data and leaked secrets in API responses.
- Used the leaked JWT secret to forge an admin token and accessed the admin API.
- Exploited an unvalidated URL fetch feature to perform SSRF and retrieve cloud metadata containing AWS keys.
- Used the AWS keys to list and access an S3 bucket containing sensitive files.
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 pre-production (staging) server is a test copy of a website, often less protected. Here, it used a weak default password and accidentally showed real production secrets, letting attackers break into the live system.
What is Info disclosure?
Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.