News for hackers. Stuff that matters.
Re:Don’t try to sanitize input – escape output by nradov on Thursday February 27, 2020 @09:09AM (#22433345)
Part of the problem is the use of a general "String" data types in many languages. Libraries that deal with SQL or HTML or anything similar shouldn't use String in their APIs. Instead they ought to have more specific "EscapedString" and "UnescapedString" types so that there's no ambiguity about which is which.
Re:Don’t try to sanitize input – escape output by xxs on Thursday February 27, 2020 @09:49AM (#22433687)
While I agree about String. EscapedString is conflating rendering/output with data model which is the core of the issue. Application developers should not care to touch escaping, nor text rendering on their right own for formats like xml, json, sql, etc.

There should not be xml build by concatenation, instead use DOM + proper render/transformer/write. Same for SQL, prepared statements + bindings...