XSS Chronicles: How I Stumbled Upon a Critical API Key Leak
An unsanitised project URL field in a developer portal allowed stored cross-site scripting, and a group invitation mechanism let attackers add victims without verification. An attacker could execute script in a victim's session and steal their API key.
medium.com
Published on medium.com
Bug hunting is a mix of patience, curiosity, and a sprinkle of luck. One moment, you’re staring at a dashboard, wondering if there’s anything interesting to poke at, and the next, you’ve got an API key leak staring right back at you.
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 application failed to sanitise or encode user-controlled input in the project URL field, and group invitations lacked a verification step.
Impact
An attacker could take over a victim's developer account and abuse API keys to interact with backend services, potentially escalating to full account takeover.
What the attacker needed
A developer account; victim is a developer; victim visits a crafted link
The fix
The issue was fixed by enforcing proper input sanitisation, restricting script execution in user-controlled fields, and adding verification for group invitations.
How it was found
- Create a developer account and register an application, noting the application ID.
- Create a group and silently add a victim developer account without their verification.
- Insert a script payload into the Product URL field, bypassing the character limit and filter.
- Send the victim a crafted URL so the script executes and steals their API key.
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 developer portal had a text box where you enter a web address. The site did not clean up what was typed there, so someone could put code instead of a normal link. When another user viewed that entry, the code ran in their browser and could read private data such as their API key.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.