How I Found a Hardcoded RSA Private Key in a Major Crypto Exchange’s Frontend -And What I Learned the Hard Way
A hardcoded RSA private key was found in a public JavaScript bundle, and the author forged a JWT token with it. However, the key was only used for logging, not authentication, and no real API endpoint accepted the forged token.
It started like any other Saturday morning. Coffee in hand, terminal open, and a fresh bug bounty target loaded up.
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 hardcoded credential (CWE-798) was embedded in client-side JavaScript, but it was used for logging token verification rather than authentication.
Impact
The exposed key was a real security concern (hardcoded credential) but did not enable authentication bypass or account takeover because it was only used for logging token verification.
What the attacker needed
None
The fix
The key should be rotated since it is now public knowledge, and private keys should not be placed in client-side code.
How it was found
- Download the main JavaScript bundle from the static host.
- Search the bundle for keywords such as private_key, secret, password, api_key, and token.
- Extract the RSA private key and validate it with OpenSSL.
- Forge a JWT token using the extracted private key.
- Test the forged token against guessed API endpoints.
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 private key is like a secret stamp that proves a message is genuine. The author found one left in a public file and used it to create a fake login token, but the system did not use that key for logins, so the fake token did not work.
What is Leaked secrets?
Keys, tokens or passwords left in public code, apps, logs or responses, that grant real access.