Skip to content
XSS Write-up Beginner

Reflected Cross-Site Scripting in Search Functionality

The search parameter 'suchfeld' is reflected unsanitised in the HTML response, allowing an attacker to inject and execute JavaScript in a victim's browser. This could lead to cookie theft, keylogging, account takeover, or redirection to malicious sites.

medium.com

Published on medium.com

A reflected Cross-Site Scripting (XSS) vulnerability exists in the search functionality of target.com. The suchfeld parameter is not properly sanitized and is reflected in the HTML response, allowing attackers to execute JS code in the user's browser.

Osamaashraf, 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 application reflects user input from the 'suchfeld' parameter into the HTML response without proper encoding or sanitisation.

Impact

An attacker could trick users into visiting a crafted link, leading to cookie/data stealing, keylogging, account takeover, or redirection to malicious sites.

What the attacker needed

Victim clicks a crafted link

How it was found

  1. Go to the target's URL: https://www.target.net/inc.search_ney.php
  2. In the search form type: <script>alert()</script>.
  3. The search results page will render the injected script.
  4. The JavaScript code executes in the victim's browser.

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.

When you type something into a search box, the website often shows it back to you on the results page. Here, the site does not clean up what you type before showing it, so if you type code instead of normal text, the browser will run that code. This lets an attacker send a link that, when clicked, runs their code on the victim's computer.

What is XSS?

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.

Similar reports

View all

Same bug class and techniques, clearest first.

Cross-site scripting (XSS)

The lesson behind this report.

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.