Yves,
> > I'm running 5.10.1 on our mailers now. I suppose I could
> > remove these localizations of $1,$2,etc and see what happens.
> > Will let you know if I can reproduce it on 5.10.1.
Done. And I believe I have it distilled now to a small test case.
> Also it would be really nice to get to the bottom of this.
>
> I have looked at the regex code and i have looked at the $1 fetch
> logic and i dont see how it possibly could ever be tainted.
>
> At the very least we should assert that it isnt.
#!/usr/bin/perl -T
use strict;
use re 'taint';
use Scalar::Util qw(tainted);
my $mailbox = 'abc@example.com';
$mailbox .= substr($ENV{PATH},0,0); # make it tainted
# $1 and $2 become tainted
my(@r) = $mailbox =~ /^(.*?)(\@.*)$/ ? ($1,$2) : ($mailbox,'');
printf("%d %d\n", tainted($1), tainted($2));
my($nm) = 'aaa-ccc'; # not tainted
printf("%d\n", tainted($nm));
$nm =~ s/^aaa-(.*)$/$1/; # $nm becomes tainted
printf("%d\n", tainted($nm));
Mark
Thread Previous
|
Thread Next