From 60fc9237033542bdd94d61cca17e1dc2a6e1933d Mon Sep 17 00:00:00 2001 From: mgb01105731 Date: Wed, 11 Oct 2023 10:01:16 +0800 Subject: [PATCH] fix CVE-2023-31484 and fix CVE-2023-31486 --- fix-CVE-2023-31484.patch | 44 +++++++++++++++++++++++++ fix-CVE-2023-31486.patch | 69 ++++++++++++++++++++++++++++++++++++++++ perl.spec | 7 +++- 3 files changed, 119 insertions(+), 1 deletion(-) create mode 100644 fix-CVE-2023-31484.patch create mode 100644 fix-CVE-2023-31486.patch diff --git a/fix-CVE-2023-31484.patch b/fix-CVE-2023-31484.patch new file mode 100644 index 0000000..cf23983 --- /dev/null +++ b/fix-CVE-2023-31484.patch @@ -0,0 +1,44 @@ +diff -Nurw perl-5.36.1/cpan/CPAN/lib/CPAN/HTTP/Client.pm perl-5.36.1_new/cpan/CPAN/lib/CPAN/HTTP/Client.pm +--- perl-5.36.1/cpan/CPAN/lib/CPAN/HTTP/Client.pm 2023-03-02 19:53:15.000000000 +0800 ++++ perl-5.36.1_new/cpan/CPAN/lib/CPAN/HTTP/Client.pm 2023-10-20 10:39:59.523582310 +0800 +@@ -6,7 +6,7 @@ + use CPAN::HTTP::Credentials; + use HTTP::Tiny 0.005; + +-$CPAN::HTTP::Client::VERSION = $CPAN::HTTP::Client::VERSION = "1.9601"; ++$CPAN::HTTP::Client::VERSION = $CPAN::HTTP::Client::VERSION = "1.9602"; + + # CPAN::HTTP::Client is adapted from parts of cpanm by Tatsuhiko Miyagawa + # and parts of LWP by Gisle Aas +@@ -32,6 +32,7 @@ + + my $want_proxy = $self->_want_proxy($uri); + my $http = HTTP::Tiny->new( ++ verify_SSL => 1, + $want_proxy ? (proxy => $self->{proxy}) : () + ); + +diff -Nurw perl-5.36.1/cpan/CPAN/lib/CPAN.pm perl-5.36.1_new/cpan/CPAN/lib/CPAN.pm +--- perl-5.36.1/cpan/CPAN/lib/CPAN.pm 2023-03-02 19:53:45.000000000 +0800 ++++ perl-5.36.1_new/cpan/CPAN/lib/CPAN.pm 2023-10-20 10:38:26.852642384 +0800 +@@ -2,7 +2,7 @@ + # vim: ts=4 sts=4 sw=4: + use strict; + package CPAN; +-$CPAN::VERSION = '2.33'; ++$CPAN::VERSION = '2.36'; + $CPAN::VERSION =~ s/_//; + + # we need to run chdir all over and we would get at wrong libraries +diff -Nurw perl-5.36.1/Porting/Maintainers.pl perl-5.36.1_new/Porting/Maintainers.pl +--- perl-5.36.1/Porting/Maintainers.pl 2023-04-10 20:20:14.000000000 +0800 ++++ perl-5.36.1_new/Porting/Maintainers.pl 2023-10-20 10:37:42.978144249 +0800 +@@ -250,7 +250,7 @@ + }, + + 'CPAN' => { +- 'DISTRIBUTION' => 'ANDK/CPAN-2.33-TRIAL.tar.gz', ++ 'DISTRIBUTION' => 'ANDK/CPAN-2.36.tar.gz', + 'FILES' => q[cpan/CPAN], + 'EXCLUDED' => [ + qr{^distroprefs/}, diff --git a/fix-CVE-2023-31486.patch b/fix-CVE-2023-31486.patch new file mode 100644 index 0000000..fbba487 --- /dev/null +++ b/fix-CVE-2023-31486.patch @@ -0,0 +1,69 @@ +diff -Nurw perl-5.36.1/cpan/HTTP-Tiny/lib/HTTP/Tiny.pm perl-5.36.1_new/cpan/HTTP-Tiny/lib/HTTP/Tiny.pm +--- perl-5.36.1/cpan/HTTP-Tiny/lib/HTTP/Tiny.pm 2023-03-02 19:53:45.000000000 +0800 ++++ perl-5.36.1_new/cpan/HTTP-Tiny/lib/HTTP/Tiny.pm 2023-10-23 12:00:21.828742143 +0800 +@@ -41,7 +41,7 @@ + #pod read or write takes longer than the timeout, the request response status code + #pod will be 599. + #pod * C — A boolean that indicates whether to validate the SSL +-#pod certificate of an C — connection (default is false) ++#pod certificate of an C — connection (default is true) + #pod * C — A hashref of C — options to pass through to + #pod L + #pod +@@ -115,7 +115,7 @@ + max_redirect => 5, + timeout => defined $args{timeout} ? $args{timeout} : 60, + keep_alive => 1, +- verify_SSL => $args{verify_SSL} || $args{verify_ssl} || 0, # no verification by default ++ verify_SSL => $args{verify_SSL} // $args{verify_ssl} // 1, # verification by default + no_proxy => $ENV{no_proxy}, + }; + +@@ -1055,7 +1055,7 @@ + timeout => 60, + max_line_size => 16384, + max_header_lines => 64, +- verify_SSL => 0, ++ verify_SSL => 1, + SSL_options => {}, + %args + }, $class; +@@ -1797,7 +1797,7 @@ + + =item * + +-C — A boolean that indicates whether to validate the SSL certificate of an C — connection (default is false) ++C — A boolean that indicates whether to validate the SSL certificate of an C — connection (default is true) + + =item * + +@@ -2069,7 +2069,7 @@ + + =back + +-B. ++B. + + Server identity verification is controversial and potentially tricky because it + depends on a (usually paid) third-party Certificate Authority (CA) trust model +@@ -2077,16 +2077,14 @@ + with self-signed certificates or certificates signed by free, community-driven + CA's such as L. + +-By default, HTTP::Tiny does not make any assumptions about your trust model, +-threat level or risk tolerance. It just aims to give you an encrypted channel +-when you need one. +- + Setting the C attribute to a true value will make HTTP::Tiny verify + that an SSL connection has a valid SSL certificate corresponding to the host + name of the connection and that the SSL certificate has been verified by a CA. + Assuming you trust the CA, this will protect against a L. If you are +-concerned about security, you should enable this option. ++attack|http://en.wikipedia.org/wiki/Man-in-the-middle_attack>. ++ ++If you are not concerned about security, and this default in Debian causes ++problems, you should disable this option. + + Certificate verification requires a file containing trusted CA certificates. + diff --git a/perl.spec b/perl.spec index 0caa2f1..f16bb06 100644 --- a/perl.spec +++ b/perl.spec @@ -1,5 +1,5 @@ # anolis_release number must be even higher, because dual-lived modules will be broken otherwise -%define anolis_release 11 +%define anolis_release 12 %global perl_version 5.36.1 %global perl_epoch 4 @@ -65,6 +65,8 @@ Patch13: perl-5.28.0-Pass-CFLAGS-to-dtrace.patch Patch200: perl-5.16.3-Link-XS-modules-to-libperl.so-with-EU-CBuilder-on-Li.patch Patch201: perl-5.16.3-Link-XS-modules-to-libperl.so-with-EU-MM-on-Linux.patch Patch202: perl-5.36.0-Add-definition-of-OPTIMIZE-to-.ph-files.patch +Patch203: fix-CVE-2023-31484.patch +Patch204: fix-CVE-2023-31486.patch BuildRequires: bash bzip2-devel coreutils findutils gcc glibc-common make BuildRequires: sed tar zlib-devel @@ -2576,6 +2578,9 @@ LC_ALL=C TEST_JOBS=$JOBS make test_harness %{_mandir}/man3/vmsish.* %changelog +* Fri Oct 20 2023 mgb01105731 - 5.36.1-12 +- fix CVE-2023-31484 and fix CVE-2023-31486 + * Tue Jul 11 2023 Funda Wang - 5.36.1-11 - New version 5.36.1 -- Gitee