This was a, um, big topic recently, so I might as well say something about it in general.
There are a handful of really basic security mistakes that tend to crop up everywhere. Before I get to them, here's how you avoid them.
ASSUME DATA IS EVIL.Anything coming from outside your code is potentially hazardous and should be treated as such. It
(
Read more... )
Comments 11
(The comment has been removed)
(The comment has been removed)
(The comment has been removed)
Reply
Reply
wait, who doesn't?
Reply
Reply
Reply
Reply
(The comment has been removed)
Unfortunately, most PHP devs switched careers from grocery bagging and have the most experience with php4 and mysql3, and think shit like "pass all your queries to a function called cleanSQL" is high end app security.
Reply
It's a matter of translating, not nuking. Avoiding tedious work is orthogonal, really.
The code I pasted was from Perl's DBI, which I linked to qualify the assertion that this problem was completely solved many years ago. But any database wrapper that isn't completely worthless has similar functionality. It's almost difficult to avoid using prepared statements, unless you're... using the C API bolted onto PHP. Sigh.
Reply
Leave a comment