The Novee Gym is open for business at Black Hat Europe

Book a meeting

The Novee Gym is open for business at Black Hat Europe

Book a meeting

Glossary › Cross-Site Request Forgery (CSRF)

Cross-Site Request Forgery (CSRF)

Explore Article +

Key Takeaways

  • Cross-site request forgery (CSRF) abuses the trust an application places in a user’s authenticated browser, causing it to send a state-changing request the user never intended.
  • MITRE tracks the weakness as CWE-352, and OWASP maps it to A01:2025 Broken Access Control in the OWASP Top 10:2025.
  • OWASP recommends framework-provided protection, synchronizer tokens or signed double-submit cookies, and treats SameSite cookies as defense in depth rather than a full replacement in most deployments.
  • Finding CSRF that matters means knowing which actions are sensitive, which is a business-context question as much as a technical one.

What Is Cross-Site Request Forgery (CSRF)?

Cross-site request forgery is an attack in which a malicious site, email or link causes a victim’s browser to send a request to an application where the victim is already logged in. Because the browser attaches the user’s session cookies automatically, the application treats the forged request as legitimate.

MITRE describes the weakness this way: the web application “does not, or cannot, sufficiently verify whether a request was intentionally provided by the user.” The attacker never sees the response. The goal is the side effect: changing an email address, transferring funds, adding an admin or altering settings.

Why CSRF Still Matters

The impact depends on the action

A CSRF flaw on a newsletter preference is a nuisance. The same flaw on an email-change or password-reset endpoint can lead to full account takeover. Severity is tied to what the forged request can do inside the application’s business logic.

Partial protection is common

Applications often protect their main forms but miss secondary endpoints: legacy routes, API calls that accept form-encoded bodies, or actions that change state over GET. Attackers look for that one unprotected path.

Browser defaults help, but do not settle it

The SameSite cookie attribute, which some browsers now apply by default, blocks many cross-site requests. OWASP still classes SameSite as defense in depth, because configuration choices, same-site subdomains and specific request types can leave gaps.

XSS undoes CSRF defenses

OWASP’s CSRF cheat sheet states plainly that cross-site scripting can defeat all CSRF mitigation techniques. A script running on the target origin can read tokens and send requests the server will accept.

How CSRF Is Tested

Inventorying state-changing actions

Testers list every request that changes data or permissions, then rank them by impact. That ranking requires understanding the application’s roles and workflows, not just its URLs.

Checking token and origin handling

For each sensitive action, testers check whether a CSRF token is required, whether it is tied to the session, and whether the server rejects requests with missing or reused tokens. They also check Origin and Referer validation.

Crafting a cross-origin proof of concept

The clearest evidence is a working proof of concept: a page hosted on another origin that triggers the action in a logged-in test account. If the state change happens, the issue is real.

Chaining with other weaknesses

Testers look at whether CSRF combines with other findings, such as an XSS bug or a weak password-change flow, to produce a higher-impact exploit chain.

CSRF vs Server-Side Request Forgery (SSRF)

Whose request is forged

In CSRF, the attacker forges a request from the victim’s browser. In server-side request forgery, the attacker makes the server itself send requests, often to internal systems.

What the attacker gains

CSRF borrows a user’s authenticated session to perform actions. SSRF borrows the server’s network position to reach resources the attacker cannot access directly.

How they are mapped

Both now sit under A01:2025 Broken Access Control in the OWASP Top 10:2025, since OWASP rolled SSRF into that category in the 2025 edition.

How Novee Approaches CSRF

Novee’s continuous AI pentesting reasons about workflows, permissions and business logic like an attacker, which helps it judge which state-changing actions are truly sensitive rather than treating every form the same. It covers web apps and APIs, retains context across testing cycles through its Asset Intelligence Model, and has three independent agents validate each finding before it is reported. Agentic Remediation then proposes a fix and retests to confirm it works.

FAQ

Not reliably. SameSite cookies block many cross-site requests, and OWASP describes narrow conditions where they can be a reasonable defense alone. In most deployments OWASP recommends treating them as defense in depth, layered with token-based protection and origin checks for state-changing requests.

They can be. APIs that authenticate with cookies and accept simple form-encoded or plain-text requests may be exploitable. APIs that require a bearer token in a custom header are generally less exposed, because browsers do not attach those headers to cross-site requests automatically.

OWASP’s guidance starts with the built-in CSRF protection of your framework. Beyond that, it recommends synchronizer tokens for stateful applications or signed double-submit cookies for stateless ones, plus origin verification, avoiding state changes over GET, and at least one defense-in-depth layer.