Cross-site request forgery (CSRF) is a trust exploitation attack in which an adversary tricks a legitimate user's browser into sending unauthorized requests to a web server on their behalf. The server processes the request as if it came from the trusted user, granting the attacker the victim's access rights.
Cross-Site Request Forgery (CSRF)
One example of a trust exploitation is a cross-site request forgery, or CSRF.
I'm on the common weakness enumeration site, where we can see all the common weaknesses that are in applications. What I'm going to do is I hit expand all to see all of the weaknesses, and we're going to do a find for CSRF, and then we will find it right here. So this is the cross-site request forgery, and I'm going to open that up. So here is the CWE 352, specifying cross-site request forgery.
It gives us a little diagram here. We can open up that diagram, and essentially what's happening is that there's a bank account, and Trudy, who's our adversary here, wants to access this bank account, specifically Alice's account, to be able to steal money from that bank account. Well, there are protections involved here that make it so Trudy can't access this bank account. But what possibly could happen — a cross-site request forgery is going to go cross-site.
So what's going to happen is Trudy is going to submit the request to Alice, which then gets sent to the bank. So it's going through Alice. Well, Alice has already been granted into this bank account — that's her bank account, so she can access it. And by Trudy sending this through Alice, then it gets executed as if Alice sent this request. And the request is to send money from Alice's bank account to Trudy's bank account.
So in this example right here, we have some sort of web services, and we have a client machine, and we have the adversary going through the client machine to gain access to the web server, therefore taking on rights of whatever this client machine has when it accesses this web server. So, cross-site request forgery. Here's the attack card on it. And it really is: the attacker makes a call through the client's machine to access the site on behalf of the client machine.
TechKnowSurge builds IT and cybersecurity professionals through hands-on, concept-first training built around real understanding — not memorization. Free interactive tools, structured programs, and 25+ years of real-world experience, all in one place.
Explore free tools and programs →