File tree 3 files changed +12
-275
lines changed 3 files changed +12
-275
lines changed Original file line number Diff line number Diff line change @@ -3662,7 +3662,6 @@ dist/Storable/t/code.t See if Storable works
3662
3662
dist/Storable/t/compat01.t See if Storable works
3663
3663
dist/Storable/t/compat06.t See if Storable works
3664
3664
dist/Storable/t/croak.t See if Storable works
3665
- dist/Storable/t/CVE-2015-1592.inc See if Storable works
3666
3665
dist/Storable/t/CVE-2015-1592.t See if Storable works
3667
3666
dist/Storable/t/dclone.t See if Storable works
3668
3667
dist/Storable/t/destroy.t Test Storable in global destructon
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1
1
# !/usr/bin/perl
2
2
3
3
use strict;
4
+ use warnings;
4
5
use Test::More;
6
+ use Storable qw( freeze thaw) ;
5
7
plan tests => 1;
6
8
7
- use File::Temp qw( tempdir) ;
8
- use File::Spec;
9
- my $tmp_dir = tempdir(CLEANUP => 1);
10
- my $tmp_file = File::Spec-> catfile($tmp_dir , ' sploit' );
9
+ # this original worked with the packaged exploit, but that
10
+ # triggers virus scanners, so test for the behaviour instead
11
+ my $x = bless \(my $y = " mt-config.cgi" ), " CGITempFile" ;
12
+
13
+ my $frozen = freeze($x );
11
14
12
- my $file = __FILE__ ;
13
- $file =~ s /\. t$/ .inc/ ;
14
- my $inc = $ENV {PERL_CORE } ? " -Ilib -I../../lib" : " -I" .join (" -I" , @INC );
15
- system qq( $^X $inc -w "$file " 2>$tmp_file ) ;
16
- open (my $fh , " <" , $tmp_file ) or die " $tmp_file $! " ;
17
15
{
18
- local $/ ;
19
- my $err = <$fh >;
20
- like($err , qr / SECURITY: Movable-Type CVE-2015-1592 Storable metasploit attack/ ,
21
- ' Detect CVE-2015-1592' );
16
+ my $warnings = ' ' ;
17
+ local $SIG {__WARN__ } = sub { $warnings .= " @_ " };
18
+ thaw($frozen );
19
+ like($warnings , qr / SECURITY: Movable-Type CVE-2015-1592 Storable metasploit attack/ ,
20
+ ' Detect CVE-2015-1592' );
22
21
}
You can’t perform that action at this time.
0 commit comments