    Announcing the beta1 release of the Safe extension for Perl5.

SUMMARY

The Safe extension module allows the creation of compartments
in which perl code can be evaluated in a restricted environment.
The beta1 release is now available (licensed under the GPL) as
    ftp://ftp.ox.ac.uk/pub/perl/Safe-b1.tar.gz
It requires perl5.001e or later (perl5.001m preferred).

INTRODUCTION

The Safe extension lets you create compartment objects, each of
which has a new namespace and an operator mask.
(1) Code evaluated in a compartment cannot see any variables (or
subroutines or filehandles...) except those which have been explicitly
placed there or explicitly shared with the real root namespace. Tricks
with globs, run-time symbol look-up and such-like cannot bypass this
restriction.
(2) Code evaluated in a compartment is evaluated subject to the
operator mask for that compartment. Perl always compiles eval'd code
into an internal format and inclusion of a masked operator causes a
compile-time error to occur. The effect is the same as when an
'eval $foo' command comes across a syntax error or other compile-time
error in the code in $foo. An error is returned and the code within
$foo is not run.

Since it is only at compile-time that operation masks cause traps,
a perl program can contain subroutines which behave as "wrappers"
and then "place" the subroutine into the namespace of a compartment.
Code evaluated in that compartment can then use that subroutine,
even though the sub contains operations which would trap if the
compartment tried to use them directly.

REQUIREMENTS

perl5.001e or later is required. With versions of perl before
perl5.001m, a patch (included with the Safe distribution) needs to
be applied to the base perl distribution. As of version perl5.001m,
the necessary op_mask code is already included under an #ifdef.
For perl5.001m, then, no patch is required but perl itself needs
to be rebuilt (with the -DUSE_OP_MASK option). I believe that
a future version of perl (probably perl5.002) will be including
the USE_OP_MASK option by default.

AVAILABILITY

    ftp://ftp.ox.ac.uk/pub/perl/Safe-b1.tar.gz

NO WARRANTY--CYA TIME

As the README says,
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.
Since this is an extension involving "security" in some sense, I have
to make even more noises than usual about disclaimers. Consider it done.

Malcolm Beattie
mbeattie@sable.ox.ac.uk
22 August 1995
