I need to cat
an untrusted file on a remote server. I'm doing this by logging in with SSH.
There are known risks related to cat
-ing untrusted files. See here.
The cat -v
option can be used to encode non-printing characters:
-v, --show-nonprinting use ^ and M- notation, except for LFD and TAB
Does this -v
option provide adequate protection against control character injection and other attacks?
There is also the -E
option, which shows a $
at the end of lines. Is there a security benefit to using -E
too?
If I were to cat
a maliciously crafted file with an exploit, which system would actually be compromised? The remote server where the file is located and the cat
command is running, or the local machine with the SSH client that is actually displaying the data?