Self XSS to Interesting Stored XSS
The report name field was vulnerable to AngularJS template injection, initially only exploitable as self-XSS. The same unsanitised name was reflected on an unauthenticated unsubscribe page, turning it into stored XSS that executes for any visitor.
Published on nahoragg.github.io
So i found this XSS in a program on Hackerone. The interesting thing about this Stored XSS is the place where it’s reflected which i found by luck while searching a way to escalate from self XSS.
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
Impact
Any user who opens the unsubscribe link would execute the injected script, regardless of authentication.
What the attacker needed
Ability to create a report with a custom name; victim opens the unsubscribe link
The fix
The application should encode or sanitise user-supplied report names before rendering them in AngularJS templates.
How it was found
- Find a place where AngularJS expressions are not encoded.
- Create a report with a malicious name containing an AngularJS expression.
- Email the report to yourself and locate the unsubscribe link.
- Open the unsubscribe link without authentication and observe the stored XSS.
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 site used AngularJS, a JavaScript framework that evaluates expressions inside double curly braces. The report name was inserted into a page without being encoded, so a crafted name containing such an expression ran as code. Because the unsubscribe page showed the name to anyone, the attack no longer required the victim to be logged in.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.