Free passive scan

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 requiredRead-only, no exploitationNo setup or code required
Used by 5,000+ developers and engineering teams
Oracle logoShopify logoGoDaddy logoChubb logoToshiba logoMAPFRE logoBelfius logoHolcim logo

A scan shows the surface. A pentest tests what gets in.

Passive scan

  • Reads what your app already exposes
  • Never logs in or submits a form
  • Cannot confirm what is exploitable

Active AI pentest

  • Tests your app the way an attacker would
  • Chains requests to confirm real exploits
  • Replays findings against your live app
  • Runs on a schedule or on demand, retests free

Probes for

  • SQL injection
  • Broken access control
  • IDOR
  • SSRF
  • Business-logic abuse

How AI pentesting works

Paid in credits. Free retests of found issues, and expert review from Standard up.

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 unguessable 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 cookies passing through the proxy so the browser
# refuses to send them on cross-site POSTs (nginx 1.19.3+).
proxy_cookie_flags ~ secure httponly samesite=lax;

# Token validation itself belongs in the application, not the proxy.

Apache

# Force SameSite + Secure on session cookies.
Header edit Set-Cookie ^(.*)$ "$1; SameSite=Lax; Secure; HttpOnly"

# Reject state-changing requests whose Origin is not ours.
RewriteEngine On
RewriteCond %{REQUEST_METHOD} ^(POST|PUT|PATCH|DELETE)$
RewriteCond %{HTTP:Origin} !^$
RewriteCond %{HTTP:Origin} !^https://example\.com$ [NC]
RewriteRule .* - [F]

Node.js (Express)

import express from "express"
import session from "express-session"

const app = express()

// Fail fast if the session secret is not configured.
const sessionSecret = process.env.SESSION_SECRET
if (!sessionSecret) throw new Error("SESSION_SECRET must be set")

// Without this, secure cookies are dropped when TLS terminates
// at a reverse proxy or load balancer in front of the app.
app.set("trust proxy", 1)

app.use(
  session({
    secret: sessionSecret,
    resave: false,
    saveUninitialized: false,
    cookie: { sameSite: "lax", secure: true, httpOnly: true },
  })
)

// Reject state-changing requests unless we can confirm a same-origin
// source. Fail closed: a missing Origin/Referer is treated as untrusted.
const ALLOWED_ORIGIN = "https://example.com"
function isSameOrigin(req) {
  // Origin is exact; compare it directly (no prefix matching, so
  // https://example.com.evil.com cannot slip through).
  if (req.headers.origin) return req.headers.origin === ALLOWED_ORIGIN
  // Fall back to Referer, comparing only its origin part.
  if (req.headers.referer) {
    try {
      return new URL(req.headers.referer).origin === ALLOWED_ORIGIN
    } catch {
      return false
    }
  }
  return false
}
app.use((req, res, next) => {
  if (["POST", "PUT", "PATCH", "DELETE"].includes(req.method) && !isSameOrigin(req)) {
    return res.sendStatus(403)
  }
  next()
})

// For per-request tokens on top of this, use a maintained library
// such as csrf-csrf. Avoid csurf - it is deprecated.

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

Fast results

Instant analysis with a detailed report. You see findings as the scan runs, not after.
Coverage

Comprehensive checks

The full passive scan runs 18 checks on the free plan, covering TLS, headers and cookies. Paid plans run 35+ and add CORS, DNS, email auth and more.
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.
FAQ

Frequently asked.

What is Barrion?
Barrion runs continuous, agentic AI penetration tests of web applications and APIs. AI agents test your app the way an attacker would, safely, on a schedule or on demand. Findings are checked against the live app before they're reported, and tracked across runs as new, still open, resolved or regressed. From Standard level up, a security engineer reviews each report. Barrion AB is based in Gothenburg, Sweden. A free passive scan is the quickest way to start.
How safe is Barrion to use for security testing?
AI pentests send real test requests, so they're rate-limited and non-destructive, and you approve the exact scope before a single request goes out. You can point them at staging too. The free passive scan only reads your live app. It never submits forms, brute-forces endpoints or touches anything that changes state, so it's safe to run against production.
What types of security issues does Barrion identify?
AI pentests look for the issues an attacker could exploit, like SQL injection, cross-site scripting and broken access control. Findings are checked against your live app, and confirmed ones come with the request and response that prove them. Anything we couldn't confirm is clearly marked and capped in severity. The passive scan catches misconfigurations in TLS and HTTPS, security headers, cookie flags, CORS policy, DNS records, email authentication (SPF, DKIM, DMARC) and network exposure.
What specific security checks does Barrion perform?
Barrion covers two surfaces. AI pentesting is the active part: specialist agents chain requests to find exploitable flaws such as SQL injection, cross-site scripting and broken access control. Findings are checked against your live app, and confirmed ones come with the request and response that prove them. The passive scan is read-only and safe to point at production. On paid plans it runs 35+ checks (18 on the free plan): transport security (HTTPS, HSTS, TLS version, cipher suites, certificate expiry, hostname and chain validity, OCSP stapling), HTTP response headers (Referrer-Policy, Permissions-Policy, X-Content-Type-Options, Content-Type, server information disclosure), CSP and framing (Content-Security-Policy, bypass detection, Trusted Types, X-Frame-Options), cross-origin policy (COOP, COEP, CORP and the full CORS header set), cookie flags and anti-CSRF tokens, mixed content, vulnerable JavaScript libraries, DNS records including DNSSEC and CAA, email authentication (SPF, DKIM, DMARC), open ports and subdomain takeover. Findings from both are ranked by severity and come with step-by-step remediation.
Will my auditor or enterprise customers accept the pentest report?
The report maps every finding to OWASP WSTG, a security engineer reviews it from Standard up and signs it off from Deep up, and a free retest shows what you fixed. Teams use it as evidence for SOC 2, ISO 27001 and NIS2 work. Whether it's accepted is up to your auditor.
How often does Barrion test my app?
Continuously or on demand. On the Business plan you save a pentest and it reruns daily, weekly, monthly, quarterly, every six months, yearly or on your own rhythm. On any plan you can start a pentest or a passive scan on demand. A passive scan also runs on a schedule and alerts you when something new shows up.
Is Barrion suitable for security testing of all business sizes?
Yes. Solo developers often start with the free passive scan and a single pentest. Teams with several apps run pentests on a schedule, and it fits alongside the tools you already run.
How does Barrion handle data security and privacy during security testing?
Passive scans are read-only: they only look at what your app already exposes publicly. For AI pentests we keep the findings in your report, and confirmed findings include the request and response behind them, so you can review and reproduce them. Test credentials you add are encrypted. Barrion is hosted in Sweden, data is stored in the EU and AI processing runs in the EU. Our trust page lists every subprocessor. Pentests are rate-limited and only run inside the scope you approve.
What if I'm not satisfied with Barrion's security testing service?
You can cancel anytime in the dashboard, and paid plans carry a 14-day refund window from the first charge. 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's pentest reports come as PDF, XLSX and JSON, mapped to all 97 OWASP WSTG test cases, with engineer review from Standard up, sign-off from Deep up and a free retest after fixes. Teams use them as evidence that supports SOC 2, ISO 27001, PCI DSS and NIS2 work. Whether a report is accepted is up to your auditor or customer.

Anything else? Email contact@barrion.io.

Keep it covered

Fix it once, then watch it stay fixed.

A pentest shows what is exploitable today. A scheduled passive scan re-checks this tool's results and alerts you when a deploy undoes the fix.

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 from €199/mo

Pentest credits every month, +17 advanced checks, weekly passive scans, email alerts and audit-ready PDFs for SOC 2 / ISO 27001 / PCI.