Join our Newsletter — 33% off our NHI Course

Should teams rely on SameSite cookies or CORS instead of CSRF tokens?

No. SameSite cookies and CORS reduce some attack paths, but they do not prove that a sensitive request was authorised by the user. They are supporting controls, while the CSRF token remains the primary check for request authenticity on state-changing actions.

Why SameSite and CORS are only supporting controls

SameSite cookies and cors help reduce cross-origin abuse, but they solve different problems from CSRF. SameSite limits when browsers attach cookies, and CORS governs which origins can read responses or make certain cross-origin requests. Neither control proves that the authenticated user intended the action, which is why a CSRF token remains the direct request-origin check for state-changing operations.

That distinction matters most for requests that change account state, move funds, update email addresses, or otherwise create side effects. If the application relies only on browser policy, the defender is depending on ambient browser behavior and origin boundaries rather than an application-level assertion that the request was deliberately authorised.

A useful way to think about the stack is that SameSite and CORS can lower exposure, but the CSRF token establishes intent. When a control reduces attack surface without binding the request to user intent, it is supplementary protection, not a substitute for authenticity.

Where the gaps remain in real deployments

CSRF defences fail when teams treat browser controls as equivalent to application validation. SameSite can be bypassed by legitimate same-site flows, older browser behaviour, or endpoints that still accept cross-site credentialed requests in some contexts. CORS is even easier to misread, because it is often implemented as a response policy for JavaScript access rather than a proof that the user authorised a transaction.

Teams also run into trouble when state-changing endpoints are mixed with JSON APIs, SPA front ends, or cross-origin integrations. In those cases, developers may see the browser block some requests and assume the problem is solved, even though a crafted form post, an allowed origin, or a misconfigured credentialed request path can still reach the application.

The practical takeaway is that browser-layer restrictions can shrink the opportunity for abuse, but they do not remove the need to validate each sensitive action at the server. That is why CSRF tokens still matter even in applications that already use SameSite and a carefully scoped CORS policy.

How to decide what belongs in the protection stack

Use SameSite and CORS as part of a layered design, not as a binary replacement decision. For state-changing requests, the application should still require a CSRF token or an equivalent request-authenticity mechanism. For read-only endpoints, public resources, and strictly token-based API designs, the risk profile is different, but the team should be clear about which flows rely on cookies and which do not.

For APIs that authenticate with bearer tokens outside the browser cookie model, CSRF risk may be lower, but it is not automatically absent. If cookies, session state, or browser-managed credentials are still part of the flow, the team should verify whether the request can be forged from another origin and whether the server can distinguish a user-triggered action from a cross-site submission.

Good practice is to document the trust model per endpoint: cookie-backed browser session, token-backed API call, or a mixed flow. That makes it easier to decide whether the control question is about browser restrictions, request authenticity, or both.

Risk and Threat Considerations

When teams over-trust SameSite or CORS, the main risk is false confidence. The application may appear hardened because some cross-origin requests fail, yet a sensitive endpoint can still accept a browser-initiated request that the user never intended.

Failure mechanism: An attacker induces the victim’s browser to send an authenticated request, and the application accepts it because it relies on cookie policy or origin policy instead of verifying a CSRF token or equivalent per-request proof of intent.

Impact: State changes can occur under the victim’s session, leading to account changes, transaction abuse, data modification, or privilege-affecting actions without the user’s awareness.

Standards & Framework Alignment

This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.

OWASP ASVS and NIST SP 800-53 Rev 5 set the technical controls, while ISO/IEC 27001:2022 defines the regulatory obligations.

Framework Control / Reference Relevance
OWASP ASVS V8 — Authorization CSRF is an authorization and request-intent control problem for state-changing actions.
V10 — OAuth and OIDC Modern browser and token flows often rely on OAuth/OIDC, where cookie and origin assumptions interact with request security.
Recommendation — Require server-side request authenticity checks for every sensitive state change. Align browser-session protections with the OAuth/OIDC flow used by the application.
NIST SP 800-53 Rev 5 SC-23 — Session Authenticity CSRF defenses depend on proving a request is genuine within an authenticated session.
IA-5 — Authenticator Management CSRF tokens behave like anti-replay request authenticators that must be issued and protected carefully.
Recommendation — Validate session-bound request authenticity before executing state-changing actions. Manage CSRF token issuance, rotation, and validation with strict lifecycle controls.
ISO/IEC 27001:2022 A.8.5 — Secure authentication Secure authentication controls must distinguish valid user action from browser-originated request abuse.
Recommendation — Implement strong authentication checks for sensitive application interactions.

Practitioner Guidance

What to verify: Check each state-changing endpoint for a server-side request-authenticity control, not just browser-enforced restrictions. If a request can change data or privileges, assume SameSite and CORS are only supporting layers unless the endpoint uses a different strong anti-CSRF pattern.

Common mistake: Treating “the browser blocked it” as proof that the application is safe. Browser policy is helpful, but it is not the same thing as a per-request authorisation check.

Practitioner takeaway: The safest design is to let SameSite and CORS reduce attack surface while the server still proves intent for sensitive actions, because origin policy is a transport constraint, not a substitute for request authenticity.