Cross-Site Scripting (XSS)
A flaw in a website lets attackers inject their own code into its pages, which then runs in visitors' browsers to steal sessions or show fake content.

Layer 7: Application Medium risk
How it works
Websites often display text that users have entered: search terms, comments, names on a booking or messages in a client portal. If the site shows that text without cleaning it first, an attacker can enter a small piece of code instead of ordinary words. When other people, including staff and administrators, view that page, their browser runs the attacker's code as if it came from your own website, with all the trust that comes with it.
That code can steal session tokens and take over accounts, change what the page shows, add fake login forms or redirect visitors to scam sites. On a client portal or online store it can expose customer information. Older custom sites, contact forms and plugins are frequent sources of this flaw. Visitors and customers usually have no way to tell anything is wrong, and they may blame your business when their accounts are misused.
Warning signs
- Strange pop-ups or redirects reported by visitors to your website
- Unexpected code or odd characters appearing in comments or form submissions
- Admin accounts on your site performing actions nobody made
- Security scanners or researchers reporting XSS flaws on your site
How to defend against it
- Keep the website platform, themes and plugins up to date
- Ask your developer to clean and encode all user input before displaying it
- Set modern browser security headers that limit which scripts can run
- Put the website behind a web application firewall
- Have the site tested for common web vulnerabilities
If it happens to you
- Remove the injected content and patch the vulnerable page or plugin
- Reset admin passwords and sign out all active website sessions
- Check whether customer data or accounts were affected and seek advice on notification
If you think this is happening right now, call our incident line at 1-800-716-8955. We answer 24 hours a day, whether or not you are a client. What to do while you wait.