Tuesday, November 12, 2024
HomeOWASP - Top 10Cross-Site Request Forgery (CSRF) - An OWASP Vulnerability - Detailed Explanation

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

Published on

Malware protection

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

Cross Site Request Forgery

- Advertisement - SIEM as a Service

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

 

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
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.

Latest articles

10 Best DNS Management Tools – 2025

Best DNS Management Tools play a crucial role in efficiently managing domain names and...

Sweet Security Announces Availability of its Cloud Native Detection & Response Platform on the AWS Marketplace

Customers can now easily integrate Sweet’s runtime detection and response platform into their AWS...

Researchers Detailed Credential Abuse Cycle

Cybercriminals exploit leaked credentials, obtained through various means, to compromise systems and data, enabling...

New Android Malware SpyAgent Taking Screenshots Of User’s Devices

SpyAgent, a newly discovered Android malware, leverages OCR technology to extract cryptocurrency recovery phrases...

Free Webinar

Protect Websites & APIs from Malware Attack

Malware targeting customer-facing websites and API applications poses significant risks, including compliance violations, defacements, and even blacklisting.

Join us for an insightful webinar featuring Vivek Gopalan, VP of Products at Indusface, as he shares effective strategies for safeguarding websites and APIs against malware.

Discussion points

Scan DOM, internal links, and JavaScript libraries for hidden malware.
Detect website defacements in real time.
Protect your brand by monitoring for potential blacklisting.
Prevent malware from infiltrating your server and cloud infrastructure.

More like this

What is XSS (Cross-Site Scripting)? – A Detailed Understanding Of the Type of XSS

XSS is a very commonly exploited vulnerability type that is very widely spread and...

OWASP A10-Unvalidated Redirects and Forwards

Web applications often redirect and forward users to other pages and websites, and use...

A-9 Using Components with known Vulnerabilities – Every Developers Should aware

Exploitability of the risk is average, Attacker needs to identify the weak part through scanning...