Stored XSS Attack
A guestbook form stored user-supplied input without sanitising it, so a script payload submitted in the message field executed in the browser when the page was reloaded. An attacker could run script in the context of anyone who viewed the guestbook.
medium.com
Published on medium.com
After running the correct command in Kali I loaded up burp and used the browser within to start intercepting traffic.
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 guestbook stored the message and rendered it back into the page without encoding or sanitising it, so markup in the message was treated as code.
Impact
Script supplied through the guestbook could run in the browser of anyone who viewed the stored entry, though the report only demonstrates an alert box.
What the attacker needed
Access to the guestbook page; an intercepting proxy
How it was found
- Open the stored XSS exercise page in the Burp browser.
- Submit a test name and message through the guestbook form.
- Intercept the resulting POST request in Burp.
- Replace the message field with a script payload and forward the request.
- Refresh the page in the browser and observe the alert confirming execution.
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 guestbook lets visitors leave a name and message that are shown to other visitors. The site saved the message exactly as typed and later displayed it as if it were part of the page, so text that looks like code runs in the browser of anyone who opens the page. This is called stored cross-site scripting because the harmful input is saved on the server and served to later visitors.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.