Free CSRF Protection Checker
Free tool
Checks for anti-CSRF tokens and SameSite cookie posture on state-changing endpoints, so attackers can't forge requests from another site.
- Anti-CSRF tokens
- SameSite strategy
- Safe methods
No credit card requiredProduction-safe (100% passive)No setup or code required
Trusted by 3,500+ security & engineering teams










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.
How to fix common failures
- Require tokens on POST/PUT/PATCH/DELETE and verify them server-side
- Use per-request tokens or double-submit with robust secrets
- Prefer SameSite=Lax by default, and use None+Secure only when needed
What this checker validates
- Presence of anti-CSRF tokens on state-changing endpoints
- SameSite cookie posture aligned with cross-site needs
Implementation examples
Once you've identified the gap, applying the fix is straightforward. Here are the three configurations developers reach for most often.
Nginx
# Harden session cookie at the edge so the browser
# refuses to send it on cross-site POSTs.
proxy_cookie_path / "/; SameSite=Lax; Secure; HttpOnly";
# Reject cross-origin state-changing requests early.
map $request_method $is_state_change {
default 0;
POST 1;
PUT 1;
PATCH 1;
DELETE 1;
}
map "$is_state_change:$http_origin" $csrf_block {
default 0;
"~^1:$" 1;
"~^1:(?!https://example\.com).*$" 1;
}
server {
if ($csrf_block) { return 403; }
}Apache
# Force SameSite + Secure on session cookies.
Header edit Set-Cookie ^(.*)$ "$1; SameSite=Lax; Secure; HttpOnly"
# Block cross-origin state-changing requests at the vhost.
<If "%{REQUEST_METHOD} =~ /^(POST|PUT|PATCH|DELETE)$/">
RewriteEngine On
RewriteCond %{HTTP:Origin} !^$
RewriteCond %{HTTP:Origin} !^https://example\.com$ [NC]
RewriteRule .* - [F,L]
</If>Node.js (Express + csurf)
import express from "express"
import cookieParser from "cookie-parser"
import csrf from "csurf"
const app = express()
app.use(cookieParser())
// Double-submit cookie strategy: token in HttpOnly cookie,
// echoed back via X-CSRF-Token header from the client.
const csrfProtection = csrf({
cookie: {
httpOnly: true,
secure: true,
sameSite: "lax",
},
})
app.use(csrfProtection)
app.get("/csrf-token", (req, res) => {
res.json({ csrfToken: req.csrfToken() })
})
// All POST/PUT/PATCH/DELETE routes now require a valid token.
app.post("/account/email", (req, res) => {
res.json({ ok: true })
})Tool-specific questions
Do I still need tokens with SameSite?
Yes. SameSite reduces cross-site cookie sending but tokens remain the primary defense for CSRF.
Should APIs use cookies or Authorization headers?
For browser apps, prefer HttpOnly Secure cookies with CSRF protections. For non-browser clients, use Authorization with CORS controls.
Why Barrion
Built for the engineers who already have enough to fix.
Speed
Real-time results
Instant analysis with a detailed report. You see findings as the scan runs, not after.
Coverage
Comprehensive checks
35+ checks per scan covering TLS, headers, CORS, cookies, DNS, email auth, and more, in a single pass.
Action
Step-by-step fixes
Every finding ships with the exact remediation step for your framework. Hand it to the engineer who owns the surface.
Other tools
More free checks, for the rest of your surface.
Complete Security Scan
Complete website security analysis with comprehensive vulnerability detection
Pre-Pentest Security Scan
Passive scan that catches the misconfigurations a pentester finds first. Use it before a manual engagement to clear the easy issues.
Security Compliance Checker
Check compliance with PCI DSS, HIPAA, SOC 2, ISO 27001, and GDPR. Get compliance readiness reports.
WAF Checker
Detect Web Application Firewall presence through passive header analysis. Identify WAF/CDN providers.
Security Headers Test
Check your website's HTTP security headers configuration
TLS/SSL Security Checker
Validate your SSL/TLS configuration and certificate setup
Related guides
Go deeper on the same topic.
FAQ
Frequently asked.
What is Barrion and how does it enhance website security?
Barrion is a security testing and monitoring platform for engineering teams, covering three products: passive DAST that continuously watches your live web apps and APIs, SAST via GitHub that scans your codebase for secrets, insecure patterns and vulnerable dependencies, and AI pentesting that runs active, agent-driven attacks with proof-of-exploit. Findings come with step-by-step fixes you can ship immediately.
How safe is Barrion to use for security testing?
Every default Barrion scan is 100% passive and read-only. We never submit forms, brute-force endpoints or interact with state-changing routes, so it's safe to run against production.
What types of security issues does Barrion identify?
Barrion is a security testing and monitoring platform, so coverage spans three surfaces. Passive DAST flags misconfigurations across TLS/HTTPS, security headers, cookie flags, CORS policy, DNS records, email authentication (SPF/DKIM/DMARC), network exposure and common web hygiene issues. SAST via GitHub finds secrets in code, insecure patterns and vulnerable dependencies. AI pentesting adds exploitable findings like SQL injection, XSS and broken access control with proof-of-exploit.
What specific security checks does Barrion perform?
Barrion checks TLS/HTTPS configuration, HTTP security headers, cookie flags, CORS policy, DNS and email authentication records, network exposure and common web hygiene issues, then prioritises them by severity with clear remediation.
What is Barrion's smart crawling?
Smart crawling automatically discovers the pages and endpoints of your app so scans cover the surface that matters, without you manually listing every URL.
How often does Barrion perform security scans?
Manual scans on demand. Continuous monitoring runs automatically on Essential (weekly+) and Business (daily), and alerts you the moment a new issue appears.
Is Barrion suitable for security testing of all business sizes?
Yes. Barrion is a security testing and monitoring platform, with passive DAST, SAST via GitHub and AI pentesting available to solo developers, startups, scale-ups and enterprise security teams alike, without adding headcount.
How does Barrion handle data security and privacy during security testing?
Scans are passive and read-only by default, and we never store or expose sensitive data from your application. Pentests are rate-limited and non-destructive, designed to confirm exploitability without altering data or affecting availability.
What if I'm not satisfied with Barrion's security testing service?
Paid plans start with a free trial, and you can cancel anytime. If something isn't right, contact us and we'll make it work for your team.
How does Barrion help with SOC 2, ISO 27001, NIS2, and other compliance frameworks?
Barrion produces audit-ready PDF and CSV reports suitable for SOC 2, ISO 27001, PCI DSS and NIS2, ready to share with auditors, customers and your board.
Anything else? Email contact@barrion.io.
Run a full report on your site.
Free first scan covers every check, no signup needed. Sign up to save the report and turn on continuous monitoring.