Code sanity check |
Site Admin
|
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 |
|
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. |
||||||||||||||
|
Code sanity check |
|
||
Content © NuSphere Corp., PHP IDE team
Powered by phpBB © phpBB Group, Design by phpBBStyles.com | Styles Database.
Powered by
Powered by phpBB © phpBB Group, Design by phpBBStyles.com | Styles Database.
Powered by