in reply to Insecure dependency in piped open
First the taint problem: the value passed into $host is probably tainted and you are not untainting it. See perldoc perlsec for more info on how to untaint data.
Another security issue is your use of exec() with a single arguement. You should use something like:
This ensures that $host will not be interpreted by the shell. If you really need to re-direct STDERR, consider using something like IPC::Open3.open(my $fh, "-|", $NSLOOKUP, "-type=any", $host) or die "unable to exec $NSLOOKUP: $!";
Here is a good write-up of the security issues around tainting and calling other processes written by brian_d_foy: Secure Programming Techniques
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Insecure dependency in piped open
by gugubanana (Acolyte) on Jun 29, 2008 at 12:46 UTC | |
by sgifford (Prior) on Jun 29, 2008 at 19:37 UTC |