3 ms·
Know what isn't vulnerable to this? Perl CGI scripts with taint mode enabled. http://perldoc.perl.org/perlsec.html#Taint-mode http://perldoc.perl.org/perlsec.ht
by peterwwillis 12y ago
Know what isn't vulnerable to this? Perl CGI scripts with taint mode enabled. http://perldoc.perl.org/perlsec.html#Taint-mode http://perldoc.perl.org/perlsec.html#Taint-mode
You may not use data derived from outside your program to affect something
else outside your program--at least, not by accident. All command line
arguments, environment variables, locale information (see perllocale),
results of certain system calls (readdir(), readlink(), the variable
of shmread(), the messages returned by msgrcv(), the password,
gcos and shell fields returned by the getpwxxx() calls), and all
file input are marked as "tainted".
Tainted data may not be used directly or indirectly in any command
that invokes a sub-shell, nor in any command that modifies files,
directories, or processes, with the following exceptions:
- phs2501 12y agoNot true if the perl script calls out to bash (i.e. via system), as it doesn't sanitize the environment: $ env x='() { :;}; echo vulnerable' perl -T -e "\$ENV{PATH} = '/bin'; system('ls | cat');" sh: warning: x: ignoring function definition attempt sh: error importing function definition for `x' ...