XSS and CSRF — A Full Kill Chain
A bookmark feature stored user input without sanitisation, allowing stored XSS. Because the bookmark creation request lacked CSRF protections, an attacker could craft a page that made a victim's browser submit a malicious bookmark, executing the payload and sending session data to the attacker.
medium.com
Published on medium.com
بس� الله، والصلاة والسلا� على رسول الله , الح� د لله الذي عَلَّ� َ بالقل� .. عَلَّ� َ الإنسانَ � ا ل� يَعْلَ� والصلاةُ والسلا� ُ على خيرِ � ُعَلِّ� ي الناسِ الخير � ح� د
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 bookmark name was rendered into the page without output encoding, and the bookmark creation endpoint lacked CSRF tokens, Origin/Referer checks, and SameSite cookies.
Impact
An attacker could execute arbitrary JavaScript in a victim's browser and exfiltrate session cookies and other sensitive information.
What the attacker needed
Victim clicks a link; victim is logged in
How it was found
- Create a new bookmark on the target site and intercept the request.
- Insert an XSS payload into the bookmark name parameter and URL-encode it.
- Generate a CSRF proof-of-concept using Burp's CSRF PoC Generator.
- Send the PoC link to the victim; when opened, the XSS payload executes and sends data to the attacker.
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 website let users save bookmarks, and it displayed the bookmark text without cleaning it first. That meant someone could save a bookmark containing code, and the site would run that code in the browser of anyone who viewed it. Separately, the site did not check that bookmark-saving requests came from its own pages, so an attacker could trick a logged-in user into saving a malicious bookmark just by visiting a link.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.