First problem: HOW does the client set "the environmental variable BAD_VAR"The classic example Shellshock is having HTTP_USER_AGENT be your bad variable
and more generally, the whole point of tainting the whole of %ENV is that you shouldn't be playing catch-up; whole thing is potentially suspect.wget -U "() { test;};echo \"Content-type: text/plain\"; echo; echo; /b +in/cat /etc/passwd" http://10.248.2.15/cgi-bin/test.cgi
where does the script you've shown us access BAD_VAR?This is exactly my point. The Perl script never accesses BAD_VAR, only the child process. Perhaps this updated case would make my vector more obvious:
The horror with Shellshock is that unless you wipe all potentially corrupted values out of %ENV, it doesn't matter what you call. Thus my original question, should I be updating that script to read#!/usr/bin/perl -wT print "Content-type: text/plain\n\n"; local $ENV{PATH} = '/usr/local/bin'; print `eval \$BAD_VAR`;
#!/usr/bin/perl -wT print "Content-type: text/plain\n\n"; local %ENV = (PATH => '/usr/local/bin'); print `eval \$BAD_VAR`;
#11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.
In reply to Re^6: Taint and Shellshock
by kennethk
in thread Taint and Shellshock
by kennethk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |