Cross Side Scripting
The text describes lab exercises where user input in a search field and a feedback form was reflected or stored without sanitisation, allowing script execution in a victim's browser. It also covers error messages and backup files that exposed internal paths, query structure and credentials.
medium.com
Published on medium.com
Cross-Site Scripting (XSS) is a client-side web vulnerability that allows attackers to inject malicious JavaScript into web applications. When executed in a victim’s browser, the script can manipulate webpage content, steal session cookies, redirect users, or perform actions on behalf of the victim.
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 echoed user-supplied input into HTML without output encoding, and also left verbose errors and backup files publicly reachable.
Impact
An attacker could run script in a victim's browser to steal session cookies or act as the user, and the leaked errors and backups could reveal paths, queries and credentials for further attacks.
What the attacker needed
Victim visits a crafted URL; or victim views a stored comment; no account needed for the search test
The fix
The text does not say the issues were fixed; it recommends validating and encoding input, disabling detailed errors in production and removing backup files from public directories.
How it was found
- Open the search page and put a script tag in the query parameter.
- Submit the request and see the script run in the browser.
- Enter a script tag into the feedback form and submit it.
- Reload the page and the stored script runs again.
- Send a non-numeric product id to trigger a verbose error page.
- Try common backup file names in the address bar until one downloads.
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 is when a website takes something a user typed and puts it back on the page without cleaning it, so a malicious snippet can run as code in another visitor's browser. Here the search box and feedback form both did this, so a crafted link or a saved comment could run a script. The same write-up also shows how error pages and leftover backup files can leak server paths and passwords.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.