Free XSS (Cross-Site Scripting) Protection Checker
Check your XSS defenses by validating CSP, X-Content-Type-Options, and Trusted Types readiness against your live URL, with step-by-step header fixes.
- X-Content-Type-Options
- CSP coverage
- Trusted Types hints

What you get for free
18 core security checks via this tool, passive scans, step-by-step remediation, security score on every result.
What Essential adds at $39/mo
+17 advanced checks, continuous monitoring, daily security score history, email alerts, GitHub SAST, board-ready PDFs, SOC 2 / ISO 27001 / PCI reports.
Implementation examples
Once you've identified the gap, applying the fix is straightforward. Here are the configurations developers reach for most often.
Nginx
add_header Content-Security-Policy "default-src 'self'; script-src 'self' 'nonce-$request_id'; object-src 'none'; base-uri 'self'; require-trusted-types-for 'script'" always;
add_header X-Content-Type-Options "nosniff" always;
add_header Referrer-Policy "strict-origin-when-cross-origin" always;Apache
Header always set Content-Security-Policy "default-src 'self'; script-src 'self'; object-src 'none'; base-uri 'self'; require-trusted-types-for 'script'"
Header always set X-Content-Type-Options "nosniff"
Header always set Referrer-Policy "strict-origin-when-cross-origin"Node.js (Express + Helmet)
import helmet from "helmet"
app.use(
helmet({
contentSecurityPolicy: {
directives: {
defaultSrc: ["'self'"],
scriptSrc: ["'self'"],
objectSrc: ["'none'"],
baseUri: ["'self'"],
requireTrustedTypesFor: ["'script'"],
},
},
xContentTypeOptions: true,
referrerPolicy: { policy: "strict-origin-when-cross-origin" },
}),
)Next.js (next.config.mjs, works on Vercel)
const nextConfig = {
async headers() {
return [
{
source: "/(.*)",
headers: [
{
key: "Content-Security-Policy",
value: "object-src 'none'; base-uri 'self'",
},
{ key: "X-Content-Type-Options", value: "nosniff" },
{ key: "Referrer-Policy", value: "strict-origin-when-cross-origin" },
],
},
]
},
}
export default nextConfigThe script-src part of an XSS-hardening CSP needs a per-request nonce, which a static config cannot generate and Next.js's own inline scripts require; set that part in middleware.ts instead. On Netlify, the static headers above go in a public/_headers file.
Built for the engineers who already have enough to fix.
Real-time results
Comprehensive checks
Step-by-step fixes
More free checks, for the rest of your surface.
Complete Security Scan
Pre-Pentest Security Scan
Security Compliance Checker
WAF Checker
Security Headers Test
TLS/SSL Security Checker
Frequently asked.
What is Barrion and how does it enhance website security?
How safe is Barrion to use for security testing?
What types of security issues does Barrion identify?
What specific security checks does Barrion perform?
What is Barrion's smart crawling?
How often does Barrion perform security scans?
Is Barrion suitable for security testing of all business sizes?
How does Barrion handle data security and privacy during security testing?
What if I'm not satisfied with Barrion's security testing service?
How does Barrion help with SOC 2, ISO 27001, NIS2, and other compliance frameworks?
Anything else? Email contact@barrion.io.