My first Bug : Uncovering a Reflected XSS with a Simple Payload
A reflected cross-site scripting flaw existed in the 'consultant' form fields of a subdomain, where user input was reflected without sanitisation. An attacker could inject a script that executes in a victim's browser, potentially stealing cookies.
Introducing my name Fir (on Linkedin). Today, I’m excited to share with you my recent discovery of a Cross-Site Scripting (XSS) vulnerability that I stumbled upon in the subdomain of an application I was testing.
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 reflected user-supplied input from the 'consultant' form fields into the page without escaping or validating it.
Impact
Attackers could potentially steal session cookies and impersonate users, access sensitive information, and damage the application's reputation.
What the attacker needed
A free account on the subdomain; victim visits a crafted link or page
The fix
The application should validate and escape all user input before rendering it, enforce a strict Content Security Policy, sanitise output with a library such as DOMPurify, and train developers on secure coding.
How it was found
- Discover subdomains of the target application using a subdomain enumeration tool.
- Register an account on the identified subdomain.
- Navigate to the 'consultant' page and locate the input fields named 'FieldOne' and 'FieldTwo'.
- Enter a script payload into those fields and click the 'Simpan' (Save) button.
- Observe that an alert box appears, confirming script 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.
Cross-site scripting (XSS) is when a website takes something you type and shows it back on the page without cleaning it first. If you type code instead of normal text, the browser runs that code as if the website itself had written it. Here, a form field on a 'consultant' page did exactly that, so a malicious script could run in another user's browser.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.