2 ms·
A previous company tried to do this with a single “clean_xss” function. It’s not possible because different contexts of code have different sanitization logic.
by thephyber 2y ago
A previous company tried to do this with a single “clean_xss” function. It’s not possible because different contexts of code have different sanitization logic. JSON encoding, URL encoding, DOM sources and sinks, HTML attributes, SCRIPT tag, CSS, etc all are escaped or sanitized in different ways.
Trying to make a single function/script with no knowledge of contexts just makes the developer sense more security than exists.
- jmholla 2y agoI should've been clearer. I just want to fantastic terminal escape sequences. It's probably as straightforward as I've imagined.