How I Earned a €2,000 Bounty by Reading a Single JavaScript File
Hardcoded AWS AppSync GraphQL API credentials were exposed in a JavaScript file loaded on the login page. An attacker could use them to query the GraphQL API and access user PII, chat conversations, logs, databases and other API keys.
So I’ve got a write-up for you today on a pretty CRAZY vulnerability I found on Intigriti. And the wildest part?
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, secret cloud credentials were embedded directly in client-side JavaScript instead of being kept on a server.
What the attacker needed
Access to the login page; browser DevTools
The fix
Secrets should not be embedded in client-side JavaScript; they should be kept server-side and access should be restricted.
How it was found
- Open the browser's DevTools on the login page and inspect the JavaScript files being loaded.
- Search the JavaScript file for keywords and find the AWS AppSync GraphQL endpoint and API key.
- Use curl to send a GraphQL query to the endpoint with the API key.
- Observe that the query returns user information and further 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.
A JavaScript file is code that runs in your browser and can be read by anyone. The developers left secret login details (an API key) inside that file, so anyone who looked could use them to talk to their cloud database and read private information.
What is Leaked secrets?
Keys, tokens or passwords left in public code, apps, logs or responses, that grant real access.