Subject: | Security Hole Renders Module::Load::Conditional unuseable under taint checking |
I've tried to use Module::Load::Conditional with Class::CGI, but I've
run into a serious problem in writing some tests. The following program
illustrates the problem:
#!/usr/bin/perl -T
use Module::Load::Conditional qw(check_install);
check_install( module => 'Data::Dumper' );
That fails with:
Insecure dependency in eval while running with -T switch at
/usr/local/lib/perl5/site_perl/5.8.7/Module/Load/Conditional.pm line
215, <GEN0> line 12.
This happens in check_install where you're iterating over directories
and trying to find the version number for a module. While you read the
lines of the module, you eventually get to this (the last line is the
line which makes things fall down and go boom):
if ( /([\$*])(([\w\:\']*)\bVERSION)\b.*\=/ ) {
### this will eval the version in to $VERSION if it
### was declared as $VERSION in the module.
### else the result will be in $res.
### this is a fix on skud's Module::InstalledVersion
local $VERSION;
my $res = eval $_;
This will not run under taint mode and is a showstopper for me. Now one
could argue that you could just skip the VERSION check if the programmer
did not pass in a "version" parameter to check_install and that would
solve the problem for me. However, that doesn't fix the security hole
for others who might need to check the version.
I'm trying to work out a solution to this problem now. Obviously, it
wont' be particularly easy and I'm not sure when I'll have anything.
Cheers,
Ovid