Bypassing XSS filter and stealing user credit card data
A search parameter was reflected inside an input field, and the site's filter stripped anything between angle brackets, so a crafted attribute payload survived and executed as script. The author then showed that the script could fetch the victim's payment details page and send its contents to an external server, exposing card data.
Published on medium.com
So here is another writeup about how I bypassed XSS filter and created a payload to get user credit card data. It was a private program on bugcrowd, let’s just say it was named Redact.
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 input was reflected into an HTML attribute context and the sanitiser only stripped content between angle brackets rather than encoding or properly filtering the value.
Impact
An attacker could run script in a victim's session and read their payment details page, potentially stealing credit card data, though the report was closed as a duplicate.
What the attacker needed
Victim visits a crafted link; victim is logged in; WAF bypass via bracket stripping
How it was found
- Put a double quote in the searchValue parameter to break out of the input field.
- Try a basic script tag payload, which the WAF blocks.
- Try an event-handler payload, which the WAF also blocks.
- Notice that anything between angle brackets is removed, and use that to split the handler name so the filter leaves a working payload.
- Confirm the alert fires, then replace it with a payload that fetches the payment details page and posts it to an external server.
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 put whatever you typed into the search box straight back into the page without cleaning it properly. A filter tried to remove dangerous tags, but it only deleted text between angle brackets, so a leftover piece of text still ran as code in the victim's browser. Because that code runs inside the logged-in page, it can read the user's own payment details and send them elsewhere.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.