What is Cross-site scripting (XSS)?
also: XSS
// short answer
A flaw that lets an attacker get their own script to run on your website, in your visitors' browsers, as if your site had sent it.
In plain English
Cross-site scripting, usually shortened to XSS, happens when a website takes something a user typed — a search term, a comment, a form field — and puts it back on a page without cleaning it first. If that input contains a script, the visitor's browser runs it.
Because the script appears to come from your site, it can do whatever your site can do in that browser: read the page, change what it shows, send form data elsewhere, or act on behalf of a logged-in user.
XSS is usually found in plugins, themes and custom forms. A passive check cannot find it — finding it needs authorised testing — but it can tell you whether safety nets such as a Content Security Policy and HttpOnly cookies are in place.
Why it matters to a small business
An XSS flaw in one contact-form plugin can be used to steal admin sessions or show your customers fake payment pages. It is one of the most common web flaws, so it is worth reducing both the chance and the impact.
What to do
- Keep your CMS, plugins and themes updated, and remove ones you no longer use.
- Add a Content Security Policy to limit what injected scripts can do.
- For sites that handle logins or payments, consider an authorised vulnerability scan or penetration test.