in reply to Insecure problem
Just a guess, but since $ENV{PATH} is already tainted, if you concatenate to $ENV{PATH}, it would still be tainted, right?
so you probably need to extract out the paths that you explicitly want, and then reassign them with the new path that you want to add
## untested, just a guess my @path; foreach my $path ( split( /:/, $ENV{PATH} ) ) { if( is_allowed_path($path) ) { ## whatever that means... push @paths, $path; } } push @paths, "/some/other/path"; $ENV{PATH} = join( ':', @paths );
Or maybe even,
delete $ENV{PATH}; $ENV{PATH} = "/path/to/tool;/some/other/path";
|
|---|