News for hackers. Stuff that matters.
Re:Google results for PHP tutorials contain SQL injection vu... by crazygringo on Sunday July 25, 2021 @11:01PM (#27955092)
You're making the perfect into the enemy of the good.

Should every tutorial be an entire 200-page course on all web security practices? Of course not.

But should every tutorial that inserts a user-provided value into a SQL statement ensure it's escaped? Of course. There's essentially literally never a situation where you shouldn't do that. It's not just to be "production-ready" -- it's so basic as just to make sure the query will still even parse if the user includes a quote character in their input.

So why on earth are you defending this mistake?

Re:Google results for PHP tutorials contain SQL injection vu... by rlayton2 on Monday July 26, 2021 @12:56AM (#27955841)
I'd go further and say it's easier to teach prepared queries than string building (or at least equally difficult).

That might not be true for other security issues but I think tutorial writers should be fine saying "here is a bit of magic that fixes a problem called csrf. We won't cover that in this course but leave this in here"