diff options
author | Gurusamy Sarathy <gsar@cpan.org> | 1998-07-06 06:41:17 +0000 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 1998-07-06 06:41:17 +0000 |
commit | e4d48cc9bddb8984cf12bdfbcbac9580d192b5a5 (patch) | |
tree | 3f490d6e52093c5f09c5b80a219d66b0ab159c02 /pod | |
parent | 06b3afcdfc1f3e17cec01aa39ec73f3f3165a28e (diff) | |
download | perl-e4d48cc9bddb8984cf12bdfbcbac9580d192b5a5.tar.gz |
allow eval-groups in patterns only if they C<use re 'eval';>
p4raw-id: //depot/perl@1334
Diffstat (limited to 'pod')
-rw-r--r-- | pod/perldiag.pod | 21 | ||||
-rw-r--r-- | pod/perlre.pod | 9 |
2 files changed, 25 insertions, 5 deletions
diff --git a/pod/perldiag.pod b/pod/perldiag.pod index 7c8ab3d482..221cc35f68 100644 --- a/pod/perldiag.pod +++ b/pod/perldiag.pod @@ -1063,6 +1063,27 @@ single form when it must operate on them directly. Either you've passed an invalid file specification to Perl, or you've found a case the conversion routines don't handle. Drat. +=item %s: Eval-group in insecure regular expression + +(F) Perl detected tainted data when trying to compile a regular expression +that contains the C<(?{ ... })> zero-width assertion, which is unsafe. +See L<perlre/(?{ code })>, and L<perlsec>. + +=item %s: Eval-group not allowed, use re 'eval' + +(F) A regular expression contained the C<(?{ ... })> zero-width assertion, +but that construct is only allowed when the C<use re 'eval'> pragma is +in effect. See L<perlre/(?{ code })>. + +=item %s: Eval-group not allowed at run time + +(F) Perl tried to compile a regular expression containing the C<(?{ ... })> +zero-width assertion at run time, at it would when the pattern contains +interpolated values. Since this is a risk to security, it is not allowed. +If you insist, you may still do this by explicitly building the pattern +from an interpolated string at run time and using that in an eval(). +See L<perlre/(?{ code })>. + =item Excessively long <> operator (F) The contents of a <> operator may not exceed the maximum size of a diff --git a/pod/perlre.pod b/pod/perlre.pod index 30608ced75..f6fdc29eea 100644 --- a/pod/perlre.pod +++ b/pod/perlre.pod @@ -330,6 +330,10 @@ Experimental "evaluate any Perl code" zero-width assertion. Always succeeds. C<code> is not interpolated. Currently the rules to determine where the C<code> ends are somewhat convoluted. +Owing to the risks to security, this is only available when the +C<use re 'eval'> pragma is used, and then only for patterns that don't +have any variables that must be interpolated at run time. + The C<code> is properly scoped in the following sense: if the assertion is backtracked (compare L<"Backtracking">), all the changes introduced after C<local>isation are undone, so @@ -360,11 +364,6 @@ other C<(?{ code })> assertions inside the same regular expression. The above assignment to $^R is properly localized, thus the old value of $^R is restored if the assertion is backtracked (compare L<"Backtracking">). -B<WARNING>: This is a grave security risk for arbitrarily interpolated -patterns. It introduces security holes in previously safe programs. -A fix to Perl, and to this documentation, will be forthcoming prior -to the actual 5.005 release. - =item C<(?E<gt>pattern)> An "independent" subexpression. Matches the substring that a |