CSRF. Easy, enormously effective, frequently misunderstood. This attack can be called a sleeping lion because it is not taken as seriously as it should be. But what and just how bad is it?
Cross-Site Request Forgery (Sometimes shortened to CSRF or XSRF, also known as “Sea Surf” or “Session Riding“) is a type of attack that forces a user to execute unauthorized actions when they’re logged in to a web application.
Such an attack occurs when a malicious website causes a user to perform an unauthorized action on another website.
It is enough to simply click on a malicious link to have your password changed or to lose all your money. That’s CSRF for you.
The impacts of such an attack can vary depending on the privileges a user has.
If the user has no administrative privileges, CSRF could change his password. However, if the user does have administrative privileges, the impacts of CSRF could be more severe – a potential attacker could compromise the entire web application.
CSRF does have a good old friend – his name is Cross-Site Scripting (XSS).
Both of these attacks have a few things in common: they are both client-side attacks and need some form of user interaction in order to cause harm – here’s where social engineering comes into play..
Social engineering relies on human interaction as it refers to psychological manipulation of people into performing actions.
Combine that with CSRF and you get an extremely powerful attack vector:
* The two domain names can look identical if the attacker utilizes an IDN Homograph attack. An IDN (Internationalized Domain Name) attack is such an attack that allows a nefarious party to deceive users about what remote system they’re communicating with by replacing each character of a legitimate system by a similar one of a foreign language.
A Cross-Site Request Forgery attack is only effective if a victim is authenticated and logged in to a web application. Here’s an example:
Even more dangerous example could involve online forums:
You browse around and see a new post, you decide to check it out. The post contains a link to a malicious website:
[img=maliciouswebsite.com/csrf][/img]
If your browser renders this image, a request to maliciouswebsite.com will be made. Here’s where you’ve got a bit of a problem – this could potentially initiate a CSRF attack.
Cross-Site Request Forgery can be mitigated in a number of ways, but perhaps the most popular one is by using tokens: properly generated tokens prevent CSRF from being exploited. How?
Imagine you’ve got a banking website which does not have any sort of CSRF protection:
Now here’s the same scenario with a CSRF token in place..
The first and second steps are the same, but the ensuing steps and the outcome are a bit different:
Cross-Site Request Forgery is an attack that forces a victim into submitting a request he is not aware of. Although the impacts of such an attack can be severe (a potential victim could have his password changed, money stolen, etc.), it can be mitigated in a number of ways. The most popular way to prevent such an attack is by generating CSRF tokens.
This blog will walk you through some lessons for conference speakers who speak remotely no…
Insecure data storage is the second vulnerability in the OWASP Mobile Top 10 list. Insecure…
The improper platform usage vulnerability is the first vulnerability in the OWASP Mobile Top 10.…
If you ever heard of web application security, you probably heard of OWASP. And if…
If you have ever built a website, chances are you took care of security. Securing…
It's November. For some developers it's just an ordinary month - for some of them…
View Comments