-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
false detection #3
Comments
As noble as the goal is, the data that drives charts seems to be wretched. For instance |
Yes there are false positives (and negatives). For performance reason, the script uses regular expressions, which provide a good enough approximation, but indeed aren't perfect. Also the script can't determine if a potential vulnerability can be exploited or not. Regarding this particular line of code, the problem is that over time, as more and more developers modify the code, it can become vulnerable to SQL injections. Today dev 1 wrote this:
Six months later, dev2 refactor to this:
A year later, dev3 comes in and writes this:
And now the code is open to SQL injections via the post variable. Had the original developer used prepared statements from day one, the code would have remained safe and maintainable (no need to check how and where a variable is used) over the years. Also we don't know where So there's no reason today to use concatenated strings like this, prepared statements are just as easy to write and way safer. |
Yet this is what the site claims it does by stating even in the chart in the top "PHP questions that contains SQL injections, per month" - should it read somewhere that this is potentional vulnerability I wouldn't say a word. In no way I'm trying to justify not using prepared statements, the point I'm trying to make is that it just shows PHP developers in really bad light for no apparent reason: according to the site ~50% of questions posted on StackOverflow that relate to PHP and MySQL ARE vulnerable to SQL injections while they may not. |
I'm not sure there's a huge difference between a "potential one" and "real one" actually. Something like However I agree that we can't know if it can be exploited or not. So I guess those are vulnerabilities that can be "potentially exploited". Maybe I could add some FAQ to the article to clarify what the data is showing (or if someone wants to make a pull request - the file to edit is index_template.html). |
seems this script thought that https://stackoverflow.com/questions/40964119/showing-query-mysqli-using-select-tag-html-input was vulnerable to SQL injections..
it isn't.
was quoted as:
04/12/2016 22:52:02: $stmt = $con->prepare('SELECT titlu, linknews, autorID, data, count FROM stiinta WHERE autorID = ? ORDER BY ? DESC');//atentie la ordine din SELECT , prin aceasta functie se scapa de $variabla=$row['COLUMN'] diferenta dintre get_result VS bind_result(avatanj nu necesita mysqlnd, dezavantaj nu merge SELECT *) ALTA DIFERENTA get_result necesita FETCH_ASSOS(), bind_result necesita doar FETCH
The text was updated successfully, but these errors were encountered: