jackdied has asked for the wisdom of the Perl Monks concerning the following question:
Is it possible to do the same thing without turning off strict refs?use strict; my $var = 'Test::foo'; no strict 'refs'; # we need to leave use strict *$var = sub {print "Bar\n";}; use strict; # turn it back on
It is true that they couldn't add any code to the modules that they couldn't just run in their box, but they could screw with the interactions to gain new powers. Here is an exploit for a restricted caller() package, in its original form it will never let the user get to caller() through safe_caller(), but if we can modify caller_allowed() they can
-jackdiedpackage SafeCaller; sub safe_caller { return caller(@_) if caller_allowed(); } # disallow everyone from using safe_caller sub caller_allowed { reutrn 0; }
keywords: use strict; use Safe; sandbox; restrict; namespace; taint;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Modifying packages without violating use strict
by broquaint (Abbot) on Feb 07, 2002 at 00:42 UTC | |
by jackdied (Monk) on Feb 07, 2002 at 01:48 UTC | |
|
Re: Modifying packages without violating use strict
by chromatic (Archbishop) on Feb 07, 2002 at 00:41 UTC |