Categories: OWASP - Top 10

Cross-Site Request Forgery (CSRF) – An OWASP Vulnerability – Detailed Explanation

Cross Site Request Forgery is one of the most common form of attack by online spammers and scammers. Exploicity of this attack is bit complex, it’s prevalence is common.

But CSRF attacks can be predicted easily and their impact is moderate.

CSRF scenario

In this scenario, we are having an Attacker, User, Attackers, and Target server. An attacker can share the malicious link to a user’s through Multiple ways.

Link sharing can be done through Social Media, Email and in many different ways. Once the user click’s on the link, then the link goes to the attacker’s web server.

Now the request from the attackers’ server also carries the Embedded Malicious request, which causes the user browser to issue a request to the target website.

Entire process of CSRF is to get the authenticated user, who is already authenticated to the target website. So that’s one of the condition normally need to meet for successful CSRF.

 

Cross-Site Request Forgery

In this scenario we are having a user transferring money on a banking website, now the user login to the bank and to makes Authenticate money transfer request.

The request should be like this HTTP POST http://bank.com/transfer, once the request processed then in-order to persist the user state server will send an Authcookie: 86GHTR.

Being the post request there is a request body which consists of Target Account number: 7895457898054 and where the money Amount: 100000  is to transfer.

Now the attacker can forge this request and he is the rub with CSRF if the attacker can trick the user’s browser in making this request when I may be able to successfully execute a CSRF request.

So now does an attacker execute that: Attacker already aware of the HTTP post path, they look at the bank and tell what’s the URL that you need to post to transfer money.

They already aware of the fields, so they only require the URL and request body, because if they get the user to make a request to that part with the request body.

Then the Auth Cookie will be sent automatically with the request which browsers normally do, send any cookie with the request valid for a target domain.

Cross-Site Request Forgery Defenses

  • CSRF is exploited if we use predictable patterns.
  • Employ Anti-forgery tokens, add randomness to the request.
  • The valid requests should not originate externally.
  • The referrer should be in each header’s requests.
  • Native browser defenses.
  • Fraud detection patterns.
Gurubaran

Gurubaran is a co-founder of Cyber Security News and GBHackers On Security. He has 10+ years of experience as a Security Consultant, Editor, and Analyst in cybersecurity, technology, and communications.

View Comments

Recent Posts

White House Considers Oracle-Led Takeover of TikTok with U.S. Investors

In a significant development, the Trump administration is reportedly formulating a plan to prevent a…

10 hours ago

Critical Vulnerability in IBM Security Directory Enables Session Cookie Theft

IBM has announced the resolution of several security vulnerabilities affecting its IBM Security Directory Integrator…

10 hours ago

Critical Apache Solr Vulnerability Grants Write Access to Attackers on Windows

A new security vulnerability has been uncovered in Apache Solr, affecting versions 6.6 through 9.7.0.…

10 hours ago

GitHub Vulnerability Exposes User Credentials via Malicious Repositories

A cybersecurity researcher recently disclosed several critical vulnerabilities affecting Git-related projects, revealing how improper handling…

11 hours ago

Critical Isolation Vulnerability in Intel Trust Domain Extensions Exposes Sensitive Data

Researchers from IIT Kharagpur and Intel Corporation have identified a significant security vulnerability in Intel…

11 hours ago

Burp Suite 2025.1 Released, What’s New!

Burp Suite 2025.1, is packed with new features and enhancements designed to improve your web…

15 hours ago