Friday, March 29, 2024

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

Cross Site Request Forgery

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

Latest articles

GoPlus’s Latest Report Highlights How Blockchain Communities Are Leveraging Critical API Security Data To Mitigate Web3 Threats

GoPlus Labs, the leading Web3 security infrastructure provider, has unveiled a groundbreaking report highlighting...

Wireshark 4.2.4 Released: What’s New!

Wireshark stands as the undisputed leader, offering unparalleled tools for troubleshooting, analysis, development, and...

Zoom Unveils AI-Powered All-In-One AI Work Workplace

Zoom has taken a monumental leap forward by introducing Zoom Workplace, an all-encompassing AI-powered...

iPhone Users Beware! Darcula Phishing Service Attacking Via iMessage

Phishing allows hackers to exploit human vulnerabilities and trick users into revealing sensitive information...

2 Chrome Zero-Days Exploited at Pwn2Own 2024: Patch Now

Google has announced a crucial update to its Chrome browser, addressing several vulnerabilities, including...

The Moon Malware Hacked 6,000 ASUS Routers in 72hours to Use for Proxy

Black Lotus Labs discovered a multi-year campaign by TheMoon malware targeting vulnerable routers and...
Guru baran
Guru baranhttps://gbhackers.com
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.

Mitigating Vulnerability Types & 0-day Threats

Mitigating Vulnerability & 0-day Threats

Alert Fatigue that helps no one as security teams need to triage 100s of vulnerabilities.

  • The problem of vulnerability fatigue today
  • Difference between CVSS-specific vulnerability vs risk-based vulnerability
  • Evaluating vulnerabilities based on the business impact/risk
  • Automation to reduce alert fatigue and enhance security posture significantly

Related Articles