News for hackers. Stuff that matters.
Re:Ask HN: How are all of these data dumps of user info happ... by cheiVia0 on Friday October 21, 2016 @10:25AM (#12760698)
Why is SQLi still a problem in 2016? Aren't we all using ORMs and SQL interfaces that only support prepared statements?
Re:Ask HN: How are all of these data dumps of user info happ... by ramimac on Friday October 21, 2016 @10:31AM (#12760744)
We really aren't; even discounting people who home-roll it, many companies just don't use existing security features of languages well. An example I've seen in action is Rails' html_safe, which I've seen multiple developers use to make user supplied content "safe," when really it is meant to demarcate data that you have ensured is safe to include
Re:Ask HN: How are all of these data dumps of user info happ... by smacktoward on Friday October 21, 2016 @11:03AM (#12761009)
Not to mention the staggering number of tiny applications that were cobbled together in the Dark Ages and never updated.
Re:Ask HN: How are all of these data dumps of user info happ... by cheiVia0 on Friday October 21, 2016 @10:39AM (#12760798)
Any thoughts on how can Ruby's html_safe be fixed to avoid that misuse of it?
Re:Ask HN: How are all of these data dumps of user info happ... by ramimac on Friday October 21, 2016 @10:47AM (#12760861)
I'm in no way an expert, so I don't know how qualified I am to comment. I'd say the issue isn't html_safe's functionality, but rather a common misunderstanding and misuse. In my experience this is steeped in the name "html_safe" itself, which leads developers to make incorrect assumptions. Really the problem is bad or uninformed developers, and you can only do so much to mitigate that.
Re:Ask HN: How are all of these data dumps of user info happ... by mikeash on Friday October 21, 2016 @11:16AM (#12761100)
I'd like to see the type system used to improve this stuff, by using more specialized types for different kinds of data. I don't think it's ultimately sensible that items as diverse as filesystem paths, SQL statements, HTML code, and raw user input are all represented as "strings." Imagine if instead you had a Path type, an SQLStatement type, an HTML type, and a UserInput type, and combining two items of mismatched types without the appropriate conversion/encoding was a hard error.
Re:Ask HN: How are all of these data dumps of user info happ... by mattnewton on Friday October 21, 2016 @11:48AM (#12761392)
Here there isn't a type system, but his example of bad developers are going out of their way to defeat defaults by casting the HTML as "safe", so I don't know what hope there is for an automated solution.