2 ms·
This is also horrifying, as it indicates that they're taking wildly destructive precautions but still putting user input into SQL queries.
by eyelidlessness 10y ago
This is also horrifying, as it indicates that they're taking wildly destructive precautions but still putting user input into SQL queries.
- kedean 10y agoI don't think the suggestion was that the policy is created because the data is going into sql queries. The policies are often in place because the people in charge of the policy flat out don't trust the developers. Say the policy comes out of the CTO's office, they have two options: 1) liberal password policy, risk a crappy developer screwing up, or 2) conservative policy, not have to worry at night.
- Buttons840 10y agoSlight change of topic here. Your comment made me realize that once a system gets too complicated the only change that can be made is to add more complexity. In this case. It would be better to ensure all SQL is properly escaped, but because that isn't a trivial task, instead you end up adding another layer of complexity.
- flomo 10y agoRight, and in larger organizations, the "they" are two completely different groups of people. My current situation: Developers in City A are expected to use secure coding standards. But the IT group in City B, halfway across the country, installs a intruder-alert proxy which blocks urls which might contain HTML or SQL. The CTO is probably too busy playing golf with Oracle salesfolks to care, everyone is just looking after their own end of the business.
- colejohnson66 10y agoI think you're misreading what the parent said. It sounded like that even if prepared queries (like PDO), some developers don't trust the database devs to Do The Right Thing(tm).
- eyelidlessness 10y agoIf they're using prepared statements, they shouldn't be doing anything about SQL injection attacks, as either the prepared statements work or they don't.
- dagss 10y agoExactly -- "if they are". Are they? How can you, as a manager, know? How can you make 100% sure that every developer to ever work on the code always does the right thing? Then consider the downside and cost of filtering the input, vs. the downside and cost of injection attack times a probability of 0.01% of a developer messing up -- and a policy, however idiotic it may seem to the individual developer, may make sense on a business level.
- eyelidlessness 10y agoI was responding to the premise. I was not responding to not the premise. Shrug.
- dragonwriter 10y agoA manager can just add easily create a policy about prepared statements as create a policy about mangling text to "protect" user input that is being put into SQL queries. And neither is easier to monitor. Adding the second as an additional policy because of uncertainty about compliance with the first is silly -- it bus you nothing where the first is complied with and gets you another monitoring problem. Better to just expend the same additional effort you'd expend monitoring the second policy to just improve monitoring the first policy.
- dagss 10y agoIt seems like you are ready to declare "second line of defense" as a silly thing in principe? Sometimes adding a second line of defense at 90% efficiency is cheaper than increasing the first line from 90% to 99%.
- 10y ago