News for hackers. Stuff that matters.
Re:Don’t try to sanitize input – escape output by laumars on Thursday February 27, 2020 @09:20AM (#22433451)
I agree you can never say never but you also can't sanitise against a risk that hasn't been defined yet simply because you wouldn't know what needs to be sanitised.

For example what if your NLP is bootstrapped from a shell script and your database content has been stripped of SQL but still contains stuff that might be interpreted as $(sub-shells)? Before long you run into a situation where literally no characters are considered safe (eg even alpha characters in the English alphabet are used as tokens in some programming languages and "what if someone builds a script in one of those languages?").

The only sane way to address the unknown is to treat raw strings as "dirty" and follow best practices when handling them (plus all the usual processes to properly test your code before it's used in production). In which case you're back to no longer needing input sanitisation.

Re:Don’t try to sanitize input – escape output by mannykannot on Thursday February 27, 2020 @09:53AM (#22433733)
My point is not that input sanitization is a solution, but that parameterized database input is not the end of the issue, from a broader, whole-systems security point of view.

Many data types have some concept of well-formedness, and in those cases, there are pragmatic reasons for only accepting well-formed input that go even beyond the security aspect.

Re:Don’t try to sanitize input – escape output by laumars on Thursday February 27, 2020 @10:26AM (#22434059)
I completely agree and I also said this in my original comment you replied to.

This is why I got confused when you said "but we should acknowledge..." (ie thinking you were raising a point other than what myself and others had already acknowledged).

Re:Don’t try to sanitize input – escape output by mannykannot on Thursday February 27, 2020 @10:32AM (#22434109)
It is not clear to me that the post I originally replied to did acknowledge this point.
Re:Don’t try to sanitize input – escape output by laumars on Thursday February 27, 2020 @10:38AM (#22434172)
> You shouldn’t need to sanitise your inputs

> Output is a different matter though

"Output" doesn't have to be front end rendered nor even internet facing. It could also be input for another internal process.

Re:Don’t try to sanitize input – escape output by mannykannot on Thursday February 27, 2020 @11:14AM (#22434489)
Indeed, so there was a point to be made.
Re:Don’t try to sanitize input – escape output by laumars on Friday February 28, 2020 @07:40AM (#22442357)
I honestly don't understand what the point you're trying to make is then.

If you're saying people should be aware that handling data safely requires more steps than just parametrised SQL then yes I touched on that, as have others, and it's not something anyone is unaware of. Hence why there has been so many high quality posts discussing the different methods of validation, sanitisation and escaping. So it's a rather strange position to assume when you say "we need to acknowledge" given that's what everyone (including me) has been doing. But it never hurts to be categoric about important points like that so your original post is still relevant.

If you're making some other point then I've already had two stabs at deciphering it and failed both times. So it's really not clear what that point is.

However if your intention was just trolling me then fine, I bit and you won.