FreshScanSentry Free vulnerability scanning for your network & web apps Run a free scan

High risk Website · Cross-site scripting

Cross-site scripting (XSS) found: what it means and how to fix it

Short answer: your website puts something a visitor typed, or something from a link, into a page without making it safe. An attacker can use that to run their own JavaScript in your visitors' browsers, on your domain, with your site's trust.

The fix: escape untrusted data wherever it's shown (most templates do this if you let them), stop inserting raw user HTML, update the plugin or theme that causes it, and add a Content-Security-Policy as a safety net.

The three kinds of XSS

Why it matters

How it looks in your report your-site.com
  1. 443 Cross Site Scripting (Reflected) Found by the Deep Scan's OWASP ZAP test High
The report shows the page and parameter affected

How it was found, and how to confirm it

In a Deep Scan, OWASP ZAP sends harmless test strings into your forms and links and checks whether they come back in a way a browser would run. Its findings name the page and the parameter, for example ?q= on /search. The free Basic Scan's Nmap scripts also look for some XSS patterns, but those are hints that need checking.

  1. Open the page and parameter from the report on your own site.
  2. Enter harmless test text such as "><b>xss-test</b> into that field or link.
  3. If xss-test appears in bold, the page is inserting your input as HTML and is vulnerable. If you see the literal characters <b>, it's escaping correctly and the finding may be a false positive.

Only test sites you own or have written permission to test.

How to fix it

WordPress and other CMS sites

Custom code

Safety nets

Then re-scan

Run another Deep Scan to confirm the finding is gone. If it was stored XSS, also remove the saved malicious content (the comment, review or form entry) from your database.

Common questions

Isn't input validation enough?

It helps, but escaping at output is what actually prevents XSS. Data can reach a page by routes your validation never saw.

The finding is on a search page that doesn't store anything.

Reflected XSS on a search page still matters: a crafted link to it can run a script for whoever clicks, including logged-in staff.

Do I need the Deep Scan to find XSS?

For a real test, yes. The free Basic Scan checks the server; the Deep Scan's ZAP test crawls your pages and forms. You can compare both on the website scanner page.

Sources: OWASP: Cross Site Scripting · OWASP XSS Prevention Cheat Sheet · ZAP alert: Cross Site Scripting (Reflected) · WordPress: escaping data