author | Craig Mohrman <craig.mohrman@oracle.com> |
Mon, 08 Apr 2013 10:05:47 -0700 | |
branch | s11u1-sru |
changeset 2556 | d05232ccfb14 |
permissions | -rw-r--r-- |
2556
d05232ccfb14
15941379 perl512 "gmake test" failures
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
1 |
|
d05232ccfb14
15941379 perl512 "gmake test" failures
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
2 |
http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2012-6329 |
d05232ccfb14
15941379 perl512 "gmake test" failures
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
3 |
CONFIRM:http://perl5.git.perl.org/perl.git/commit/1735f6f53ca19f99c6e9e39496c486af323ba6a8 |
d05232ccfb14
15941379 perl512 "gmake test" failures
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
4 |
|
d05232ccfb14
15941379 perl512 "gmake test" failures
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
5 |
From 1735f6f53ca19f99c6e9e39496c486af323ba6a8 Mon Sep 17 00:00:00 2001 |
d05232ccfb14
15941379 perl512 "gmake test" failures
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
6 |
From: Brian Carlson <[email protected]> |
d05232ccfb14
15941379 perl512 "gmake test" failures
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
7 |
Date: Wed, 28 Nov 2012 08:54:33 -0500 |
d05232ccfb14
15941379 perl512 "gmake test" failures
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
8 |
Subject: [PATCH] Fix misparsing of maketext strings. |
d05232ccfb14
15941379 perl512 "gmake test" failures
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
9 |
|
d05232ccfb14
15941379 perl512 "gmake test" failures
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
10 |
Case 61251: This commit fixes a misparse of maketext strings that could |
d05232ccfb14
15941379 perl512 "gmake test" failures
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
11 |
lead to arbitrary code execution. Basically, maketext was compiling |
d05232ccfb14
15941379 perl512 "gmake test" failures
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
12 |
bracket notation into functions, but neglected to escape backslashes |
d05232ccfb14
15941379 perl512 "gmake test" failures
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
13 |
inside the content or die on fully-qualified method names when |
d05232ccfb14
15941379 perl512 "gmake test" failures
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
14 |
generating the code. This change escapes all such backslashes and dies |
d05232ccfb14
15941379 perl512 "gmake test" failures
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
15 |
when a method name with a colon or apostrophe is specified. |
d05232ccfb14
15941379 perl512 "gmake test" failures
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
16 |
|
d05232ccfb14
15941379 perl512 "gmake test" failures
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
17 |
--- perl-5.12.5/AUTHORS-orig 2013-03-05 22:57:22.320359148 -0600 |
d05232ccfb14
15941379 perl512 "gmake test" failures
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
18 |
+++ perl-5.12.5/AUTHORS 2013-03-05 22:58:13.374206098 -0600 |
d05232ccfb14
15941379 perl512 "gmake test" failures
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
19 |
@@ -139,6 +139,7 @@ Brent B. Powers <[email protected]> |
d05232ccfb14
15941379 perl512 "gmake test" failures
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
20 |
Brent Dax <[email protected]> |
d05232ccfb14
15941379 perl512 "gmake test" failures
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
21 |
Brooks D Boyd |
d05232ccfb14
15941379 perl512 "gmake test" failures
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
22 |
Brian Callaghan <[email protected]> |
d05232ccfb14
15941379 perl512 "gmake test" failures
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
23 |
+Brian Carlson <[email protected]> |
d05232ccfb14
15941379 perl512 "gmake test" failures
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
24 |
Brian Clarke <[email protected]> |
d05232ccfb14
15941379 perl512 "gmake test" failures
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
25 |
brian d foy <[email protected]> |
d05232ccfb14
15941379 perl512 "gmake test" failures
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
26 |
Brian Grossman |
d05232ccfb14
15941379 perl512 "gmake test" failures
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
27 |
--- perl-5.12.5/dist/Locale-Maketext/lib/Locale/Maketext/Guts.pm-orig 2013-03-05 23:00:24.953530801 -0600 |
d05232ccfb14
15941379 perl512 "gmake test" failures
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
28 |
+++ perl-5.12.5/dist/Locale-Maketext/lib/Locale/Maketext/Guts.pm 2013-03-05 23:01:05.801008668 -0600 |
d05232ccfb14
15941379 perl512 "gmake test" failures
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
29 |
@@ -140,21 +140,9 @@ sub _compile { |
d05232ccfb14
15941379 perl512 "gmake test" failures
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
30 |
# 0-length method name means to just interpolate: |
d05232ccfb14
15941379 perl512 "gmake test" failures
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
31 |
push @code, ' ('; |
d05232ccfb14
15941379 perl512 "gmake test" failures
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
32 |
} |
d05232ccfb14
15941379 perl512 "gmake test" failures
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
33 |
- elsif($m =~ /^\w+(?:\:\:\w+)*$/s |
d05232ccfb14
15941379 perl512 "gmake test" failures
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
34 |
- and $m !~ m/(?:^|\:)\d/s |
d05232ccfb14
15941379 perl512 "gmake test" failures
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
35 |
- # exclude starting a (sub)package or symbol with a digit |
d05232ccfb14
15941379 perl512 "gmake test" failures
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
36 |
+ elsif($m =~ /^\w+$/s |
d05232ccfb14
15941379 perl512 "gmake test" failures
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
37 |
+ # exclude anything fancy, especially fully-qualified module names |
d05232ccfb14
15941379 perl512 "gmake test" failures
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
38 |
) { |
d05232ccfb14
15941379 perl512 "gmake test" failures
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
39 |
- # Yes, it even supports the demented (and undocumented?) |
d05232ccfb14
15941379 perl512 "gmake test" failures
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
40 |
- # $obj->Foo::bar(...) syntax. |
d05232ccfb14
15941379 perl512 "gmake test" failures
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
41 |
- $target->_die_pointing( |
d05232ccfb14
15941379 perl512 "gmake test" failures
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
42 |
- $_[1], q{Can't use "SUPER::" in a bracket-group method}, |
d05232ccfb14
15941379 perl512 "gmake test" failures
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
43 |
- 2 + length($c[-1]) |
d05232ccfb14
15941379 perl512 "gmake test" failures
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
44 |
- ) |
d05232ccfb14
15941379 perl512 "gmake test" failures
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
45 |
- if $m =~ m/^SUPER::/s; |
d05232ccfb14
15941379 perl512 "gmake test" failures
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
46 |
- # Because for SUPER:: to work, we'd have to compile this into |
d05232ccfb14
15941379 perl512 "gmake test" failures
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
47 |
- # the right package, and that seems just not worth the bother, |
d05232ccfb14
15941379 perl512 "gmake test" failures
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
48 |
- # unless someone convinces me otherwise. |
d05232ccfb14
15941379 perl512 "gmake test" failures
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
49 |
- |
d05232ccfb14
15941379 perl512 "gmake test" failures
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
50 |
push @code, ' $_[0]->' . $m . '('; |
d05232ccfb14
15941379 perl512 "gmake test" failures
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
51 |
} |
d05232ccfb14
15941379 perl512 "gmake test" failures
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
52 |
else { |
d05232ccfb14
15941379 perl512 "gmake test" failures
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
53 |
@@ -208,7 +196,9 @@ sub _compile { |
d05232ccfb14
15941379 perl512 "gmake test" failures
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
54 |
elsif(substr($1,0,1) ne '~') { |
d05232ccfb14
15941379 perl512 "gmake test" failures
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
55 |
# it's stuff not containing "~" or "[" or "]" |
d05232ccfb14
15941379 perl512 "gmake test" failures
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
56 |
# i.e., a literal blob |
d05232ccfb14
15941379 perl512 "gmake test" failures
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
57 |
- $c[-1] .= $1; |
d05232ccfb14
15941379 perl512 "gmake test" failures
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
58 |
+ my $text = $1; |
d05232ccfb14
15941379 perl512 "gmake test" failures
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
59 |
+ $text =~ s/\\/\\\\/g; |
d05232ccfb14
15941379 perl512 "gmake test" failures
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
60 |
+ $c[-1] .= $text; |
d05232ccfb14
15941379 perl512 "gmake test" failures
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
61 |
|
d05232ccfb14
15941379 perl512 "gmake test" failures
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
62 |
} |
d05232ccfb14
15941379 perl512 "gmake test" failures
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
63 |
elsif($1 eq '~~') { # "~~" |
d05232ccfb14
15941379 perl512 "gmake test" failures
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
64 |
@@ -246,7 +236,9 @@ sub _compile { |
d05232ccfb14
15941379 perl512 "gmake test" failures
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
65 |
else { |
d05232ccfb14
15941379 perl512 "gmake test" failures
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
66 |
# It's a "~X" where X is not a special character. |
d05232ccfb14
15941379 perl512 "gmake test" failures
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
67 |
# Consider it a literal ~ and X. |
d05232ccfb14
15941379 perl512 "gmake test" failures
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
68 |
- $c[-1] .= $1; |
d05232ccfb14
15941379 perl512 "gmake test" failures
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
69 |
+ my $text = $1; |
d05232ccfb14
15941379 perl512 "gmake test" failures
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
70 |
+ $text =~ s/\\/\\\\/g; |
d05232ccfb14
15941379 perl512 "gmake test" failures
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
71 |
+ $c[-1] .= $text; |
d05232ccfb14
15941379 perl512 "gmake test" failures
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
72 |
} |
d05232ccfb14
15941379 perl512 "gmake test" failures
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
73 |
} |
d05232ccfb14
15941379 perl512 "gmake test" failures
Craig Mohrman <craig.mohrman@oracle.com>
parents:
diff
changeset
|
74 |
} |