Discovering and Exploiting an XSS Vulnerability in a Large Finance Website
An XSS vulnerability was found on a finance website where a crafted payload in a JSON request could execute script. An attacker could run arbitrary JavaScript in a victim's browser, potentially stealing data or performing actions as the user.
Published on medium.com
The first step in identifying vulnerabilities is to gather information about the target website. For this purpose, I used several reconnaissance tools and techniques:
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 failed to properly validate or encode user-supplied input in a JSON request, allowing script to be reflected in the response.
Impact
An attacker could execute arbitrary JavaScript in a victim's browser, potentially leading to data theft or account compromise, though the text does not detail specific consequences.
What the attacker needed
Victim visits a crafted URL or page; attacker can send JSON requests
The fix
The website's security team implemented input validation, output encoding, and a Content Security Policy to fix the vulnerability.
How it was found
- Performed reconnaissance using subdomain enumeration, vulnerability scanning, and port scanning to find a specific URL.
- Identified input fields that could be vulnerable to XSS, such as search fields and header fields.
- Submitted various XSS payloads to different input fields and observed the responses.
- Discovered that the vulnerability required a JSON content type and successfully exploited it.
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.
Cross-Site Scripting (XSS) is a flaw where a website lets an attacker sneak JavaScript code into a page that other people view. When a victim loads the page, their browser runs the attacker's code as if it came from the site, which can steal cookies or change what the user sees. Here, the researcher found that a specially crafted request to a login-related URL could make the site run script.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.