3 ms·
While on the topic, does anybody have a good utility to sanitize things? I'm imagining something I can pipe to: xclip -selection clipboard -o | sanitize I
by jmholla 2y ago
While on the topic, does anybody have a good utility to sanitize things? I'm imagining something I can pipe to:
xclip -selection clipboard -o | sanitize
I've been meaning to throw something together myself, but I worry I'd miss something.
- thephyber 2y agoA 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.