3 ms·
BTW: there is no such thing as generic sanitized string. There may be SQL-escaped string, HTML-escaped, JS-escaped, JS-in-HTML-in-SQL-escaped, etc. It always de
by pornel 13y ago
BTW: there is no such thing as generic sanitized string. There may be SQL-escaped string, HTML-escaped, JS-escaped, JS-in-HTML-in-SQL-escaped, etc. It always depends on context (I'm going to invent format that uses ASCII 'a' in escape sequence — sanitize that! ;)
- kruhft 13y agoBase64 encode a string and it's generically sanitized. They're a bit difficult to read with the naked eye though.
- damncabbage 13y agoUnless it's in a URL. (This is why URL-safe Base64 versions exist... Which can then in turn be inappropriate for other places.)
- mikeash 13y agoAnd base64 can use the / character, so it's unsafe for POSIX filenames.
- wglb 13y agoUntil the next element in the pipeline chain decodes it and you can then have injection.
- michaelochurch 13y agoSure. I was just using one example of sanitization: defense against Bobby Tables.