http://qs321.pair.com?node_id=1041049


in reply to Re^4: Getting information about a remote file via SSH: how to escape the filename
in thread Getting information about a remote file via SSH: how to escape the filename

How can you discern a valid filename from a malicious one in a generic way?

I probably couldn't.

I actually haven't seen an attack through malicious filenames in 20 years.
*knock on wood*

The olden days war story goes along the lines of files containing unix brand conforming line breaks followed by commands. Those were aimed at the habit of some superuser types using scripts with xargs(1) for file system tidyup tasks or such and ending up with unwanted command execution. I find I don't remember that very well.

Generally I'd prefer my file names to contain [\w.-] exclusively... the world out there please hear my wishful plea :-)

Cheers, Sören

(hooked on the Perl Programming language)