News for hackers. Stuff that matters.
Re:Go Language – Web Application Secure Coding Practices by taeric on Friday June 23, 2017 @07:20PM (#14623476)
I've always had issue with this advice for this very reason. Worse, when people sanitize in and out of the database. Double encoded html just cracks me up.

I'm a big fan of not necessarily sanitizing, but treating it appropriate in context. This may mean removing characters, or mapping them, or just delimiting the entire thing.

To that end, I argue that you should not necessarily sanitize on the way to the storage mechanism. You should only sanitize at the boundaries. So, a web view should make sure any strings are treated as strings. A database layer should make sure query parameters are not able to alter the query. Etc.

(All of this is trying to simply reinforce your point.)

Re:Go Language – Web Application Secure Coding Practices by paulddraper on Friday June 23, 2017 @08:35PM (#14623759)
Right. It should be SQL sanitized (parameterized) going into the database, and and then HTML/PDF/whatever Santosh when it is put in one of those formats.