How I Found My First Stored XSS || WAF & Characters Limitation Bypass
A stored cross-site scripting flaw existed in the shared-list title, which reflected a user's first name without HTML encoding. An attacker could inject a short script tag that loaded an external script, allowing session cookie theft and account takeover.
Hello everyone, and welcome to my first write-up! In this write-up I’m excited to share a unique Stored XSS discovery that involved bypassing a Web Application Firewall and character limitations.
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 HTML-encoded the name on the profile page but failed to encode it when rendering the shared-list title, and the input length limit was applied only to the first name field.
Impact
The retrieved cookies contained session cookies, so an attacker could gain account takeover of users who viewed the shared list.
What the attacker needed
Ability to register an account; victim views the shared list; external script host with short URL
How it was found
- Register an account and try to submit special characters in the Name field; the form blocks submission without an error.
- Intercept the registration request with Burp Suite and add special characters to the name parameter to bypass the front-end check.
- Observe that the profile endpoint HTML-encodes the characters, but the shared-list title shows them unencoded.
- Create a new account each time because the name cannot be changed, and try a script payload that the WAF blocks with a 403 response.
- Use an alternative image payload with an onerror handler to confirm the stored XSS is triaged.
- Craft a short script tag that loads an external script and uses URL fragment or parameter syntax to stay within the 30-character limit and bypass the WAF's block on the greater-than sign.
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.
When a website puts user input into a page without encoding it, characters like < and > can be treated as HTML code instead of text. Here the attacker's name was shown unencoded in a shared list title, so a small script tag could run in other users' browsers. That script could read the victim's session cookie, which is like a temporary login key, and send it to the attacker.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.