News for hackers. Stuff that matters.
Re:Web Developer Security Checklist by sho on Tuesday May 16, 2017 @01:46AM (#14347635)
My apologies - my brain focussed on "stored procedures" and that's what my rant was addressing. Prepared statements are great and I'd use them whereever possible - totally agreed.
Re:Web Developer Security Checklist by wglb on Tuesday May 16, 2017 @08:28PM (#14354584)
Stored procedures offer no inherent protection.
Re:Web Developer Security Checklist by flukus on Wednesday May 17, 2017 @12:41AM (#14355702)
Often they will make the problem worse if you're doing string concatenation to create dynamic queries in a stored proc.
Re:Web Developer Security Checklist by ams6110 on Tuesday May 16, 2017 @09:56AM (#14349590)
Nothing wrong with stored procedures. Like anything else, they might not be right for every application.
Re:Web Developer Security Checklist by Terr_ on Tuesday May 16, 2017 @04:37PM (#14353099)
IMO you should either (A) avoid customizing the database and treat it as a relatively commodity data store or (B) treat it as its own service with its own developers (DBAs) that just happens to use an SQL connection as its network interface.

Some of the most horrible systems are when people just went half-way, and you've got logic randomly scattered between two systems with two programming languages etc.

Re:Web Developer Security Checklist by cookiecaper on Tuesday May 16, 2017 @11:42AM (#14350431)
The image of sprocs continues to suffer from "store all application logic in the database" syndrome, which was all the rage in the early and mid 00s before APIs started to take off. There's nothing necessarily inherently wrong with that approach, but most people have gravitated away from it. DBA/dev split probably had something to do with it.
Re:Web Developer Security Checklist by e12e on Tuesday May 16, 2017 @12:00PM (#14350607)
I'd venture the real reason is many devs know too little of normalisation, data structure and structured data.

Somehow a mess of structures/data objects paired with functions working on these objects - with only ad-hoc ways of enforcing foreign key relationships are seen as "easier", and "better for maintenance" than leveraging an actual (relational) database management system.

Sure it's more fun writing functions than thinking about data integrity - but the vast number of applications are concerned with managing structured information: from scenes in a game that could be interlocking state-machines to the more mundane user/message pairs or similar.

Design is eschewed for prototyping - but then the prototype is kept as the production system, rather than as a basis for design of a better (simpler) system.

Re:Web Developer Security Checklist by cookiecaper on Tuesday May 16, 2017 @12:30PM (#14350866)
If document databases like MongoDB have taught us anything, it's that developers hate any sort of data organization, which is ridiculous and ironic since most of their day-to-day is about manipulating data. Mongo is popular because it allows the developer to stuff a value without thinking about its structure and role, generally leading to utter disaster further down the road.

I do think the biggest problem is that it brought everything into the DBA's turf, and made it too difficult for devs to do their jobs without meddling. As long as there is a dev/DBA organizational dichotomy, there will have to be a structural dichotomy in the software (cf. Conway's Law).

Re:Web Developer Security Checklist by e12e on Tuesday May 16, 2017 @12:44PM (#14351012)
I wonder how many developers would consider using the filesystem as a document store bad practice, but at the same time be happy using mongodb.

It's odd that with the rise of solid, free rdbms' like postgresql (and the current generation of mysql forks) - the general reaction among developers hasn't been to realize that 99% of systems are/should be data-first/data centric - but rather a stubborn struggle to pretend their language supports transaction-guaranteed persisted runtime/memory -- without actually using a real object database like zoodb (for python) or gemstone.