Hacker Newsnew | comments | ask | jobs | submitlogin
How to deal with incompetence, I mean SQL injection (networkworld.com)
7 points by dnaquin 818 days ago | comments


7 points by jrockway 818 days ago | link

The article seems to paint SQL injection attacks as though they're incredibly hard to prevent and are thus unavoidable. Obviously, that's completely wrong. You have to go out of your way to allow SQL injection.

The solution to SQL injection attacks is to hire programmers to write your application, not bums off the street. What a concept.

(There is one case where I'll forgive the developers; a while back there was a MySQL library bug that let bind variables inject SQL in certain cases. That's not the fault of the app developer, and it was fixed with a library update.)

-----

3 points by okeumeni 818 days ago | link

Fire the folks in charge.

SQL injection vulnerability is a sign of poor process design and weak programming.

-----

3 points by dnaquin 818 days ago | link

Especially when The contractor had no idea how to find and fix the Web page vulnerability that allowed the SQL injection attack code to execute successfully.

-----

2 points by Prrometheus 818 days ago | link

What do you have to do besides escaping special characters in input fields?

-----

3 points by jfornear 818 days ago | link

Everytime SQL injection comes up everyone says how easy it is to prevent with one line of code, and then no one ever shares that one line!

From Wikipedia: Using Parameterized Statements Parameterized statements use parameters (sometimes called placeholders or bind variables) instead of embedding user input in the statement. In many cases, the SQL statement is fixed. The user input is then assigned (bound) to a parameter. This is an example using Java and the JDBC API: PreparedStatement prep = conn.prepareStatement("SELECT * FROM USERS WHERE PASSWORD=?"); prep.setString(1, pwd);

-----

0 points by okeumeni 818 days ago | link

Embedded SQL is poor programming period!

-----




Lists | RSS | Search | Bookmarklet | Guidelines | FAQ | News News | Feature Requests | Y Combinator | Apply | Library

Analytics by Mixpanel