in reply to Re: Re: Insecure dependency on perl module
in thread Insecure dependency on perl module
The recommended regular expression for untainting data (from perlsec) would be:
if ($data =~ /^([-\@\w.]+)$/) { $data = $1; # $data now untainted } else { die "Bad data in $data"; # log this somewhere }
This may however mean that you will have to modify your code to run under -T and possibly a chroot environment or else you could have potentially nasty users causing harm to your system.
Have a read through the "Laundering and Detecting Tainted Data" and "Cleaning Up Your Path" sections of perlsec.
Update - See davorg's post here for an update on this problem.
Ooohhh, Rob no beer function well without!
|
|---|