![]() |
|
We don't bite newbies here... much | |
PerlMonks |
Re: Insecure CPAN module in taint modeby kcott (Bishop) |
on Jul 07, 2021 at 04:30 UTC ( #11134747=note: print w/replies, xml ) | Need Help?? |
G'day Bod, I didn't see it mentioned anywhere in the thread, so I thought I'd point out a general problem that you could be experiencing. Here's a taint_test module:
Here's a script that tries to clean $ENV{PATH}:
But that fails:
The problem here is that the assignment to $ENV{PATH} occurs at runtime, whereas loading taint_test occurs at compile time. The order of the statements makes no difference: compile time happens before runtime. Here's a subtly different version of the first script:
And this one works:
Both assignment and loading occur at compile time; the order of the statements now matters. Here's a third version of the script with the order of statements changed:
And, as expected, this fails:
Bear this in mind for things other than untainting $ENV{PATH}. — Ken
In Section
Seekers of Perl Wisdom
|
|