The History Behind My First Bug
A client-side template injection in a skill name field led to stored XSS, allowing an attacker to steal admin cookies and hijack the admin session. The same issue was found in an event name field.
Published on dropn0w.medium.com
Today, I want to tell you the story of my first bug. Actually, it was not only one but a double bug.
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 used client-side templating without proper sanitisation, allowing user input to be evaluated as a template expression.
Impact
An attacker with a Manager account could execute stored XSS against an Admin, steal their cookies (since HttpOnly was not used), and hijack the admin session.
What the attacker needed
Manager account; Victim (Admin) views the injected content; HttpOnly not set on cookies
How it was found
- Inject the template injection payload {{7*7}} into a field and save it.
- Access the page again and see the output 49, confirming template injection.
- Try traditional SSTI payloads but get blocked by a WAF.
- Trigger an error that reveals the framework is Angular-related.
- Use a client-side template injection payload that bypasses the WAF to achieve stored XSS.
- As a Manager, create a skill with the payload; when an Admin views it, the XSS executes and steals cookies.
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.
The application took user input and inserted it into a template that was evaluated in the browser, so a special code like {{7*7}} was calculated to 49. This let an attacker run their own JavaScript in other users' browsers, and because the admin's cookies were not protected, the attacker could take over the admin account.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.