Cross-Site Scripting Prevention

Cross-Site Scripting Prevention with Browser-Native CSP Enforcement

Output encoding and secure code review won't catch everything. CSP is the second line of defence. Report URI is how you deploy, monitor, and enforce it without breaking your site.

Trusted by Security Teams

Why Code-Level Defenses Aren't Enough

How XSS gets past your existing defences

XSS doesn't need your whole application to be vulnerable. It needs one gap — and that gap is often somewhere your code-level defences can't reach.

Input

The missed input

One unencoded field, one overlooked parameter, one edge case in a legacy template. In April 2026 the gap at Instructure was a file attached to a support ticket, which sidestepped a sanitiser guarding the markup around it. In Ivanti Endpoint Manager it was a device name — CVE-2025-10573, written by an unauthenticated request and rendered later in an administrator's dashboard.

Dependency

The compromised dependency

A third-party script changes after you approved it. The XSS isn't in your code — it's in a dependency you don't control and didn't review.

Browser

The browser-layer injection

Your code is clean; the execution environment isn't. In Operation RoundPress a spearphishing email injected JavaScript straight into the victim's open webmail page, and in Zimbra CVE-2023-37580 a crafted link lifted the session token. Neither wrote anything to disk for endpoint tooling to find — the payload existed only in the browser, for as long as the page was open.

What These Have in Common

Untrusted content, rendered in a privileged session

Read those incidents together and the same architecture appears in every one. Content nobody vetted — a support ticket, an email, a device name — is rendered inside a session that has reach: across tenants, across mailboxes, across every managed endpoint in the estate. The vulnerability is the cheap part. What turns it into a breach is where the payload lands.

The support ticket is the back door to your admin console, and your admin console is the front door to every customer.

- Scott Helme, on the Canvas breach

It also answers the most common objection to any of this, which is that you don't have user-generated content. Ivanti had no forum and no ticket queue in the payload path. It had device names. Any field an untrusted system can write and a privileged human later reads is user-generated content, and most estates have far more of them than anyone has counted — log viewers, asset inventories, error dashboards, webhook payloads, filenames.

A nonce-based policy with no 'unsafe-inline' breaks the chain at the point that matters: the injected script carries no nonce, so it never executes and the session is never taken. That is the mitigation, and it is worth being straight about its limits — Google's own published material puts roughly a quarter of XSS bugs as still exploitable in an application running a strict CSP.

Which is why the reporting half is the part that pays. At Canvas, four days passed between the payload firing in a support agent's session and anyone noticing unusual API activity. A policy running in report-only on that one internal tool would have said so on day one — an inline script with no nonce is the loudest, simplest signal there is. Google's own XSS numbers are the long-run version of the same argument: cross-site scripting fell from 30% of their vulnerability reward payouts in 2018 to 4.1% in 2023.

CSP is the browser-native mechanism designed for XSS protection when code-level defences miss. The challenge is deploying and enforcing it at scale.

What Report URI Does

How Report URI delivers cross-site scripting prevention

Client-side security that delivers XSS detection and enforcement through CSP — browser-native, no agents, no injected scripts, no code running on your behalf.

CSP Reporting

Detect XSS attempts in real browsers

Every CSP violation from every user session is logged and searchable. See exactly what's being blocked, what's attempting to execute, and where the violation originated. Catch XSS attempts in production as they happen.

Learn more about CSP Reporting →
CSP Wizard

Build a deployable policy without guesswork

Collect seven days of data from real browser sessions, get a complete inventory of every resource your site loads, and build an enforceable CSP in clicks. The hardest part of XSS prevention with CSP is getting the policy right. The Wizard solves that.

Learn more about the CSP Wizard →
Script Watch

Detect when dependencies change

Continuous monitoring of every script executing across your site. When a third-party dependency is modified, a new script appears, or an approved resource starts behaving differently, you know immediately. Catch compromised dependencies before they become an XSS vector.

Learn more about Script Watch →
CSP Builder

Maintain your policy as your site evolves

Import your existing policy, update it as resources change, and generate the new header. CSP breaks when policies go stale. The Builder keeps enforcement up to date without manual header editing.

Learn more about the CSP Builder →
The Gap in Existing Tools

Why existing XSS protection tools miss the browser layer

Your scanners, code review, and WAF all do important work. None of them can see what's actually executing in a real user's browser right now.

DAST / Scanners

They test code, not live browsers

DAST and vulnerability scanners test your application for XSS vulnerabilities in code. They don't tell you whether an XSS attack is happening right now in a real user's browser.

Code Review

It only covers code you control

Code review and output encoding catch the vulnerabilities you know about in code you control. They can't cover third-party scripts, compromised CDNs, or browser-layer injections.

WAF

It never sees in-browser execution

WAFs filter known attack patterns at the network edge. A script that's already executing in the browser — loaded from an approved but compromised source — never crosses the WAF.

X-XSS-Protection

The old browser filter is gone

The deprecated X-XSS-Protection header was the browser's own XSS filter. Every major browser has removed it. CSP is what replaced it — but a CSP header without tooling to monitor violations and enforce policy is a header nobody maintains.

CSP is the browser's built-in defence against XSS. Report URI is what makes it operational.

No agent. No proxy. No deployment risk.

Live on your site in minutes

Report URI is browser-native. It works through the Reporting API already built into modern browsers. You add a reporting endpoint to your existing CSP header.

HTTP response header
Content-Security-Policy: default-src 'self';
  report-uri https://your-subdomain.report-uri.com/r/d/csp/enforce

Start in report-only mode. See everything before you enforce anything. Move to enforcement when you're confident in the policy.

No agent to install

No traffic routed through a third party

No changes to your infrastructure

No impact on site performance

Site functions normally even if Report URI is unavailable

Get Started

Start preventing cross-site scripting with CSP that actually works

Browser-native. No infrastructure changes. See everything before you enforce anything.

30-day free trial  ·  One header  ·  No infrastructure changes  ·  Report-only to enforcement

What it covers. What it doesn't.

Cross-site scripting prevention: what's covered

Report URI is the client-side security layer that makes CSP operational — deployment, monitoring, enforcement, and ongoing management. It's the second line of defence against XSS, not a replacement for secure coding.

Report URI covers Doesn't replace
CSP deployment and enforcement Output encoding / secure coding
XSS attempt detection in real browsers DAST / vulnerability scanning
Script change and dependency monitoring Penetration testing
Policy management and maintenance Secure code review

Vendors who promise to do all of it usually inject their own code into your pages — another attack surface. Report URI doesn't. Nothing runs on your behalf, so nothing can break, slow down, or get compromised.

“Report URI has given us the capability to seamlessly build and roll out new Content Security Policies with a high level of confidence. The unopinionated and technology-agnostic nature of Report URI allowed us to integrate it directly and easily into our existing workflows, and to gain instant visibility into CSP reports.”

Colin Barr, Head of InfoSec and IT  ·  Paddle