Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Securing my site

Tags:

security

php

I'm auditing my website with w3af.

It says it found several issues on my site, but I doubt that's really the case.

One of the issues is:

The URL: http://localhost/en/login is vulnerable to cross site request forgery. It allows the attacker to exchange the method from POST to GET when sending data to the server.

I'm pretty sure it isn't vulnerable to a csrf attack since I have used crsf protection in my forms (field with token which gets checked).

So I am wondering what this message is about:

It allows the attacker to exchange the method from POST to GET when sending data to the server.

I don't care if an attacker would be able to switch from POST to GET or do I?

And if I do can you please explain why I do? How can it be exploited?

like image 893
PeeHaa Avatar asked Nov 22 '11 21:11

PeeHaa


People also ask

How we can secure our website?

Keep your website information off-site. Do not store your backups on the same server as your website; they are as vulnerable to attacks too. Choose to keep your website backup on a home computer or hard drive. Find an off-site place to store your data and to protect it from hardware failures, hacks, and viruses.

Can you secure your website for free?

In order to secure a website for free, you should: Install an SSL certificate. Update your website on a regular basis or activate automatic updates either from your hosting provider or a third-party add-on. Use strong passwords and urge your employees to do so.


1 Answers

Coming from a point of view of no experience with w3af, I would assume that it has some pretty basic rules written into it and it checks those rules and reports back on them.

In this case it will probably check whether you have used $_REQUEST instead of $_POST or $_GET and then report an error if it finds it, regardless of the efforts you have made to secure this.

Everyone will code differently so getting software to understand the context of your code would be an amazing achievement and probably be beyond the intelligence of this one. This is not meant as an attack on the software, but to be honest if I came up with some program that could understand the context and intent of someone else's code, I wouldn't be giving it away on sourceforge :p

Does it matter? Maybe depending on how well you have secured the site (see Marc B's (+1) comment above).

-- EDIT --

By using $_REQUEST instead of specifying $_POST or $_GET you have left yourself open to an area of attack that is easily closed. Not only this but $_REQUEST also includes $_COOKIE. This has been covered here rather than me duplicating someone else's answer.

like image 79
Matt Asbury Avatar answered Nov 08 '22 11:11

Matt Asbury