diff options
-rw-r--r-- | meta/recipes-devtools/perl/files/CVE-2023-31486-0001.patch | 215 | ||||
-rw-r--r-- | meta/recipes-devtools/perl/files/CVE-2023-31486-0002.patch | 36 | ||||
-rw-r--r-- | meta/recipes-devtools/perl/perl_5.34.1.bb | 2 |
3 files changed, 253 insertions, 0 deletions
diff --git a/meta/recipes-devtools/perl/files/CVE-2023-31486-0001.patch b/meta/recipes-devtools/perl/files/CVE-2023-31486-0001.patch new file mode 100644 index 0000000000..d29996ddcb --- /dev/null +++ b/meta/recipes-devtools/perl/files/CVE-2023-31486-0001.patch | |||
@@ -0,0 +1,215 @@ | |||
1 | From 77f557ef84698efeb6eed04e4a9704eaf85b741d | ||
2 | From: Stig Palmquist <git@stig.io> | ||
3 | Date: Mon Jun 5 16:46:22 2023 +0200 | ||
4 | Subject: [PATCH] Change verify_SSL default to 1, add ENV var to enable | ||
5 | insecure default - Changes the `verify_SSL` default parameter from `0` to `1` | ||
6 | |||
7 | Based on patch by Dominic Hargreaves: | ||
8 | https://salsa.debian.org/perl-team/interpreter/perl/-/commit/1490431e40e22052f75a0b3449f1f53cbd27ba92 | ||
9 | |||
10 | CVE: CVE-2023-31486 | ||
11 | |||
12 | - Add check for `$ENV{PERL_HTTP_TINY_SSL_INSECURE_BY_DEFAULT}` that | ||
13 | enables the previous insecure default behaviour if set to `1`. | ||
14 | |||
15 | This provides a workaround for users who encounter problems with the | ||
16 | new `verify_SSL` default. | ||
17 | |||
18 | Example to disable certificate checks: | ||
19 | ``` | ||
20 | $ PERL_HTTP_TINY_SSL_INSECURE_BY_DEFAULT=1 ./script.pl | ||
21 | ``` | ||
22 | |||
23 | - Updates to documentation: | ||
24 | - Describe changing the verify_SSL value | ||
25 | - Describe the escape-hatch environment variable | ||
26 | - Remove rationale for not enabling verify_SSL | ||
27 | - Add missing certificate search paths | ||
28 | - Replace "SSL" with "TLS/SSL" where appropriate | ||
29 | - Use "machine-in-the-middle" instead of "man-in-the-middle" | ||
30 | |||
31 | Upstream-Status: Backport [https://github.com/chansen/p5-http-tiny/commit/77f557ef84698efeb6eed04e4a9704eaf85b741d] | ||
32 | |||
33 | Signed-off-by: Soumya <soumya.sambu@windriver.com> | ||
34 | --- | ||
35 | cpan/HTTP-Tiny/lib/HTTP/Tiny.pm | 86 ++++++++++++++++++++++----------- | ||
36 | 1 file changed, 57 insertions(+), 29 deletions(-) | ||
37 | |||
38 | diff --git a/cpan/HTTP-Tiny/lib/HTTP/Tiny.pm b/cpan/HTTP-Tiny/lib/HTTP/Tiny.pm | ||
39 | index 5803e45..1808c41 100644 | ||
40 | --- a/cpan/HTTP-Tiny/lib/HTTP/Tiny.pm | ||
41 | +++ b/cpan/HTTP-Tiny/lib/HTTP/Tiny.pm | ||
42 | @@ -39,10 +39,14 @@ sub _croak { require Carp; Carp::croak(@_) } | ||
43 | #pod C<$ENV{no_proxy}> —) | ||
44 | #pod * C<timeout> — Request timeout in seconds (default is 60) If a socket open, | ||
45 | #pod read or write takes longer than the timeout, an exception is thrown. | ||
46 | -#pod * C<verify_SSL> — A boolean that indicates whether to validate the SSL | ||
47 | -#pod certificate of an C<https> — connection (default is false) | ||
48 | +#pod * C<verify_SSL> — A boolean that indicates whether to validate the TLS/SSL | ||
49 | +#pod certificate of an C<https> — connection (default is true). Changed from false | ||
50 | +#pod to true in version 0.083. | ||
51 | #pod * C<SSL_options> — A hashref of C<SSL_*> — options to pass through to | ||
52 | #pod L<IO::Socket::SSL> | ||
53 | +#pod * C<$ENV{PERL_HTTP_TINY_SSL_INSECURE_BY_DEFAULT}> - Changes the default | ||
54 | +#pod certificate verification behavior to not check server identity if set to 1. | ||
55 | +#pod Only effective if C<verify_SSL> is not set. Added in version 0.083. | ||
56 | #pod | ||
57 | #pod Passing an explicit C<undef> for C<proxy>, C<http_proxy> or C<https_proxy> will | ||
58 | #pod prevent getting the corresponding proxies from the environment. | ||
59 | @@ -108,11 +112,17 @@ sub timeout { | ||
60 | sub new { | ||
61 | my($class, %args) = @_; | ||
62 | |||
63 | + # Support lower case verify_ssl argument, but only if verify_SSL is not | ||
64 | + # true. | ||
65 | + if ( exists $args{verify_ssl} ) { | ||
66 | + $args{verify_SSL} ||= $args{verify_ssl}; | ||
67 | + } | ||
68 | + | ||
69 | my $self = { | ||
70 | max_redirect => 5, | ||
71 | timeout => defined $args{timeout} ? $args{timeout} : 60, | ||
72 | keep_alive => 1, | ||
73 | - verify_SSL => $args{verify_SSL} || $args{verify_ssl} || 0, # no verification by default | ||
74 | + verify_SSL => defined $args{verify_SSL} ? $args{verify_SSL} : _verify_SSL_default(), | ||
75 | no_proxy => $ENV{no_proxy}, | ||
76 | }; | ||
77 | |||
78 | @@ -131,6 +141,13 @@ sub new { | ||
79 | return $self; | ||
80 | } | ||
81 | |||
82 | +sub _verify_SSL_default { | ||
83 | + my ($self) = @_; | ||
84 | + # Check if insecure default certificate verification behaviour has been | ||
85 | + # changed by the user by setting PERL_HTTP_TINY_SSL_INSECURE_BY_DEFAULT=1 | ||
86 | + return (($ENV{PERL_HTTP_TINY_INSECURE_BY_DEFAULT} || '') eq '1') ? 0 : 1; | ||
87 | +} | ||
88 | + | ||
89 | sub _set_proxies { | ||
90 | my ($self) = @_; | ||
91 | |||
92 | @@ -1038,7 +1055,7 @@ sub new { | ||
93 | timeout => 60, | ||
94 | max_line_size => 16384, | ||
95 | max_header_lines => 64, | ||
96 | - verify_SSL => 0, | ||
97 | + verify_SSL => HTTP::Tiny::_verify_SSL_default(), | ||
98 | SSL_options => {}, | ||
99 | %args | ||
100 | }, $class; | ||
101 | @@ -2009,11 +2026,11 @@ proxy | ||
102 | timeout | ||
103 | verify_SSL | ||
104 | |||
105 | -=head1 SSL SUPPORT | ||
106 | +=head1 TLS/SSL SUPPORT | ||
107 | |||
108 | Direct C<https> connections are supported only if L<IO::Socket::SSL> 1.56 or | ||
109 | greater and L<Net::SSLeay> 1.49 or greater are installed. An exception will be | ||
110 | -thrown if new enough versions of these modules are not installed or if the SSL | ||
111 | +thrown if new enough versions of these modules are not installed or if the TLS | ||
112 | encryption fails. You can also use C<HTTP::Tiny::can_ssl()> utility function | ||
113 | that returns boolean to see if the required modules are installed. | ||
114 | |||
115 | @@ -2021,7 +2038,7 @@ An C<https> connection may be made via an C<http> proxy that supports the CONNEC | ||
116 | command (i.e. RFC 2817). You may not proxy C<https> via a proxy that itself | ||
117 | requires C<https> to communicate. | ||
118 | |||
119 | -SSL provides two distinct capabilities: | ||
120 | +TLS/SSL provides two distinct capabilities: | ||
121 | |||
122 | =over 4 | ||
123 | |||
124 | @@ -2035,24 +2052,17 @@ Verification of server identity | ||
125 | |||
126 | =back | ||
127 | |||
128 | -B<By default, HTTP::Tiny does not verify server identity>. | ||
129 | - | ||
130 | -Server identity verification is controversial and potentially tricky because it | ||
131 | -depends on a (usually paid) third-party Certificate Authority (CA) trust model | ||
132 | -to validate a certificate as legitimate. This discriminates against servers | ||
133 | -with self-signed certificates or certificates signed by free, community-driven | ||
134 | -CA's such as L<CAcert.org|http://cacert.org>. | ||
135 | +B<By default, HTTP::Tiny verifies server identity>. | ||
136 | |||
137 | -By default, HTTP::Tiny does not make any assumptions about your trust model, | ||
138 | -threat level or risk tolerance. It just aims to give you an encrypted channel | ||
139 | -when you need one. | ||
140 | +This was changed in version 0.083 due to security concerns. The previous default | ||
141 | +behavior can be enabled by setting C<$ENV{PERL_HTTP_TINY_SSL_INSECURE_BY_DEFAULT}> | ||
142 | +to 1. | ||
143 | |||
144 | -Setting the C<verify_SSL> attribute to a true value will make HTTP::Tiny verify | ||
145 | -that an SSL connection has a valid SSL certificate corresponding to the host | ||
146 | -name of the connection and that the SSL certificate has been verified by a CA. | ||
147 | -Assuming you trust the CA, this will protect against a L<man-in-the-middle | ||
148 | -attack|http://en.wikipedia.org/wiki/Man-in-the-middle_attack>. If you are | ||
149 | -concerned about security, you should enable this option. | ||
150 | +Verification is done by checking that that the TLS/SSL connection has a valid | ||
151 | +certificate corresponding to the host name of the connection and that the | ||
152 | +certificate has been verified by a CA. Assuming you trust the CA, this will | ||
153 | +protect against L<machine-in-the-middle | ||
154 | +attacks|http://en.wikipedia.org/wiki/Machine-in-the-middle_attack>. | ||
155 | |||
156 | Certificate verification requires a file containing trusted CA certificates. | ||
157 | |||
158 | @@ -2060,9 +2070,7 @@ If the environment variable C<SSL_CERT_FILE> is present, HTTP::Tiny | ||
159 | will try to find a CA certificate file in that location. | ||
160 | |||
161 | If the L<Mozilla::CA> module is installed, HTTP::Tiny will use the CA file | ||
162 | -included with it as a source of trusted CA's. (This means you trust Mozilla, | ||
163 | -the author of Mozilla::CA, the CPAN mirror where you got Mozilla::CA, the | ||
164 | -toolchain used to install it, and your operating system security, right?) | ||
165 | +included with it as a source of trusted CA's. | ||
166 | |||
167 | If that module is not available, then HTTP::Tiny will search several | ||
168 | system-specific default locations for a CA certificate file: | ||
169 | @@ -2081,13 +2089,33 @@ system-specific default locations for a CA certificate file: | ||
170 | |||
171 | /etc/ssl/ca-bundle.pem | ||
172 | |||
173 | +=item * | ||
174 | + | ||
175 | +/etc/openssl/certs/ca-certificates.crt | ||
176 | + | ||
177 | +=item * | ||
178 | + | ||
179 | +/etc/ssl/cert.pem | ||
180 | + | ||
181 | +=item * | ||
182 | + | ||
183 | +/usr/local/share/certs/ca-root-nss.crt | ||
184 | + | ||
185 | +=item * | ||
186 | + | ||
187 | +/etc/pki/tls/cacert.pem | ||
188 | + | ||
189 | +=item * | ||
190 | + | ||
191 | +/etc/certs/ca-certificates.crt | ||
192 | + | ||
193 | =back | ||
194 | |||
195 | An exception will be raised if C<verify_SSL> is true and no CA certificate file | ||
196 | is available. | ||
197 | |||
198 | -If you desire complete control over SSL connections, the C<SSL_options> attribute | ||
199 | -lets you provide a hash reference that will be passed through to | ||
200 | +If you desire complete control over TLS/SSL connections, the C<SSL_options> | ||
201 | +attribute lets you provide a hash reference that will be passed through to | ||
202 | C<IO::Socket::SSL::start_SSL()>, overriding any options set by HTTP::Tiny. For | ||
203 | example, to provide your own trusted CA file: | ||
204 | |||
205 | @@ -2097,7 +2125,7 @@ example, to provide your own trusted CA file: | ||
206 | |||
207 | The C<SSL_options> attribute could also be used for such things as providing a | ||
208 | client certificate for authentication to a server or controlling the choice of | ||
209 | -cipher used for the SSL connection. See L<IO::Socket::SSL> documentation for | ||
210 | +cipher used for the TLS/SSL connection. See L<IO::Socket::SSL> documentation for | ||
211 | details. | ||
212 | |||
213 | =head1 PROXY SUPPORT | ||
214 | -- | ||
215 | 2.40.0 | ||
diff --git a/meta/recipes-devtools/perl/files/CVE-2023-31486-0002.patch b/meta/recipes-devtools/perl/files/CVE-2023-31486-0002.patch new file mode 100644 index 0000000000..45452be389 --- /dev/null +++ b/meta/recipes-devtools/perl/files/CVE-2023-31486-0002.patch | |||
@@ -0,0 +1,36 @@ | |||
1 | From a22785783b17cbaa28afaee4a024d81a1903701d | ||
2 | From: Stig Palmquist <git@stig.io> | ||
3 | Date: Sun Jun 18 11:36:05 2023 +0200 | ||
4 | Subject: [PATCH] Fix incorrect env var name for verify_SSL default | ||
5 | |||
6 | The variable to override the verify_SSL default differed slightly in the | ||
7 | documentation from what was checked for in the code. | ||
8 | |||
9 | This commit makes the code use `PERL_HTTP_TINY_SSL_INSECURE_BY_DEFAULT` | ||
10 | as documented, instead of `PERL_HTTP_TINY_INSECURE_BY_DEFAULT` which was | ||
11 | missing `SSL_` | ||
12 | |||
13 | CVE: CVE-2023-31486 | ||
14 | |||
15 | Upstream-Status: Backport [https://github.com/chansen/p5-http-tiny/commit/a22785783b17cbaa28afaee4a024d81a1903701d] | ||
16 | |||
17 | Signed-off-by: Soumya <soumya.sambu@windriver.com> | ||
18 | --- | ||
19 | cpan/HTTP-Tiny/lib/HTTP/Tiny.pm | 2 +- | ||
20 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
21 | |||
22 | diff --git a/cpan/HTTP-Tiny/lib/HTTP/Tiny.pm b/cpan/HTTP-Tiny/lib/HTTP/Tiny.pm | ||
23 | index ebc34a1..65ac8ff 100644 | ||
24 | --- a/cpan/HTTP-Tiny/lib/HTTP/Tiny.pm | ||
25 | +++ b/cpan/HTTP-Tiny/lib/HTTP/Tiny.pm | ||
26 | @@ -148,7 +148,7 @@ sub _verify_SSL_default { | ||
27 | my ($self) = @_; | ||
28 | # Check if insecure default certificate verification behaviour has been | ||
29 | # changed by the user by setting PERL_HTTP_TINY_SSL_INSECURE_BY_DEFAULT=1 | ||
30 | - return (($ENV{PERL_HTTP_TINY_INSECURE_BY_DEFAULT} || '') eq '1') ? 0 : 1; | ||
31 | + return (($ENV{PERL_HTTP_TINY_SSL_INSECURE_BY_DEFAULT} || '') eq '1') ? 0 : 1; | ||
32 | } | ||
33 | |||
34 | sub _set_proxies { | ||
35 | -- | ||
36 | 2.40.0 | ||
diff --git a/meta/recipes-devtools/perl/perl_5.34.1.bb b/meta/recipes-devtools/perl/perl_5.34.1.bb index e0ee006e50..db306d0be3 100644 --- a/meta/recipes-devtools/perl/perl_5.34.1.bb +++ b/meta/recipes-devtools/perl/perl_5.34.1.bb | |||
@@ -19,6 +19,8 @@ SRC_URI = "https://www.cpan.org/src/5.0/perl-${PV}.tar.gz;name=perl \ | |||
19 | file://0001-cpan-Sys-Syslog-Makefile.PL-Fix-_PATH_LOG-for-determ.patch \ | 19 | file://0001-cpan-Sys-Syslog-Makefile.PL-Fix-_PATH_LOG-for-determ.patch \ |
20 | file://0001-Fix-build-with-gcc-12.patch \ | 20 | file://0001-Fix-build-with-gcc-12.patch \ |
21 | file://CVE-2023-31484.patch \ | 21 | file://CVE-2023-31484.patch \ |
22 | file://CVE-2023-31486-0001.patch \ | ||
23 | file://CVE-2023-31486-0002.patch \ | ||
22 | " | 24 | " |
23 | SRC_URI:append:class-native = " \ | 25 | SRC_URI:append:class-native = " \ |
24 | file://perl-configpm-switch.patch \ | 26 | file://perl-configpm-switch.patch \ |