NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
Code sanity check


Joined: 04 Feb 2005
Posts: 26
Reply with quote
Hello

Anyone got an idea of a tool integrated with PHPEd that will allow coders to run a SQL injection and code backdoors checker?
I've seen a java tool that suppose to do that but is rather slow for real big scripts.

Would be nice a inline alert every time one use a POST or GET var in a unsafe way to get alerted or something... or simple select from menu to run the through the checker.

I know it's not realy easy, but is Gold Smile

Thanks

Regards,
Crirus
View user's profileFind all posts by CrirusSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8344
Reply with quote
it's not that simple. Even good code analysis can't help with many cases. For example, theoretically it's possible to analyze if posted data comes to the output and therefore script is vulnerable in terms of XSS attack. But what if one script stores posted input into DB, then another script show it?
SQL injection is simplier to check but not always. You may use something like $dbinstance=new $myclass['something']; $dbinstance->somemethodtocall($SQL);
How would analyzer guess what class somemethodtocall belongs to?

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 04 Feb 2005
Posts: 26
Reply with quote
Of course there is no bullet proof checker and the tool should not be built as if is against the coder to catch malicious coders or something.

Still, there may be good cases where you simply forget to escape a submitted data and would be nice to "search" for this cases that end up with raw POST sent back to output or database.

Regards,
Crirus
View user's profileFind all posts by CrirusSend private message


Joined: 14 Jun 2007
Posts: 67
Reply with quote
Crirus wrote:
Of course there is no bullet proof checker and the tool should not be built as if is against the coder to catch malicious coders or something.

Still, there may be good cases where you simply forget to escape a submitted data and would be nice to "search" for this cases that end up with raw POST sent back to output or database.

Regards,
Crirus

Wouldn't a better option be programmer habits? I mean, if you have a habit of only accessing data from, say, $filtered[] then you know the data is safe. You would have to put the data into $filtered, but would filter as it's inserted. Then for output you would escape the values in $filtered.

This is part of the core principles used in Essential PHP Security by Chris Shiflett. While I admit that I'm not overly consistent with this in regards to input, it does affect my coding by making sure I escape all (most) outputs.
View user's profileFind all posts by CjungeSend private message
Code sanity check
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic