builtin functionality, it can rely less upon external (and possibly
untrustworthy) programs to accomplish its purposes.
+=head1 SECURITY VULNERABILITY CONTACT INFORMATION
+
+If you believe you have found a security vulnerability in Perl, please email
+perl5-security-report@perl.org with details. This points to a closed
+subscription, unarchived mailing list. Please only use this address for
+security issues in the Perl core, not for modules independently distributed on
+CPAN.
+
+=head1 SECURITY MECHANISMS AND CONCERNS
+
+=head2 Taint mode
+
Perl automatically enables a set of special security checks, called I<taint
mode>, when it detects its program running with differing real and effective
user or group IDs. The setuid bit in Unix permissions is mode 04000, the
This is quite different, however, from not even trusting the writer of the
code not to try to do something evil. That's the kind of trust needed
when someone hands you a program you've never seen before and says, "Here,
-run this." For that kind of safety, check out the Safe module,
-included standard in the Perl distribution. This module allows the
+run this." For that kind of safety, you might want to check out the Safe
+module, included standard in the Perl distribution. This module allows the
programmer to set up special compartments in which all system operations
-are trapped and namespace access is carefully controlled.
+are trapped and namespace access is carefully controlled. Safe should
+not be considered bullet-proof, though: it will not prevent the foreign
+code to set up infinite loops, allocate gigabytes of memory, or even
+abusing perl bugs to make the host interpreter crash or behave in
+unpredictable ways. In any case it's better avoided completely if you're
+really concerned about security.
=head2 Security Bugs
Fortunately, sometimes this kernel "feature" can be disabled.
Unfortunately, there are two ways to disable it. The system can simply
outlaw scripts with any set-id bit set, which doesn't help much.
-Alternately, it can simply ignore the set-id bits on scripts. If the
-latter is true, Perl can emulate the setuid and setgid mechanism when it
-notices the otherwise useless setuid/gid bits on Perl scripts. It does
-this via a special executable called F<suidperl> that is automatically
-invoked for you if it's needed.
+Alternately, it can simply ignore the set-id bits on scripts.
However, if the kernel set-id script feature isn't disabled, Perl will
complain loudly that your set-id script is insecure. You'll need to
should never have to specify this yourself. Most modern releases of
SysVr4 and BSD 4.4 use this approach to avoid the kernel race condition.
-Prior to release 5.6.1 of Perl, bugs in the code of F<suidperl> could
-introduce a security hole.
-
=head2 Protecting Your Programs
There are a number of ways to hide the source to your Perl programs,
language, not just Perl).
If you're concerned about people profiting from your code, then the
-bottom line is that nothing but a restrictive licence will give you
+bottom line is that nothing but a restrictive license will give you
legal security. License your software and pepper it with threatening
statements like "This is unpublished proprietary software of XYZ Corp.
Your access to it does not give you permission to use it blah blah
-blah." You should see a lawyer to be sure your licence's wording will
+blah." You should see a lawyer to be sure your license's wording will
stand up in court.
=head2 Unicode
Sorting - the quicksort algorithm used in Perls before 5.8.0 to
implement the sort() function is very easy to trick into misbehaving
-so that it consumes a lot of time. Nothing more is required than
-resorting a list already sorted. Starting from Perl 5.8.0 a different
-sorting algorithm, mergesort, is used. Mergesort is insensitive to
-its input data, so it cannot be similarly fooled.
+so that it consumes a lot of time. Starting from Perl 5.8.0 a different
+sorting algorithm, mergesort, is used by default. Mergesort cannot
+misbehave on any input.
=back
See L<http://www.cs.rice.edu/~scrosby/hash/> for more information,
-and any computer science textbook on the algorithmic complexity.
+and any computer science textbook on algorithmic complexity.
=head1 SEE ALSO