Skip to content
Leaked secrets Write-up Beginner

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.

Hacker MD Follow

Published on infosecwriteups.com

It started like any other Saturday morning. Coffee in hand, terminal open, and a fresh bug bounty target loaded up.

Hacker MD, on infosecwriteups.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 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

  1. Download the main JavaScript bundle from the static host.
  2. Search the bundle for keywords such as private_key, secret, password, api_key, and token.
  3. Extract the RSA private key and validate it with OpenSSL.
  4. Forge a JWT token using the extracted private key.
  5. 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.

More by Hacker MD

View all

12 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.