Skip to content

Commit

Permalink
(perl #133706) remove exploit code from Storable
Browse files Browse the repository at this point in the history
Storable packaged the metasploit framework code for CVE-2015-1592,
which triggered virus scanners.

To prevent that remove the packaged exploit code and test for the
underlying structure we trigger the warning on.
  • Loading branch information
tonycoz committed Dec 5, 2018
1 parent f9fd003 commit fb5f378
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 275 deletions.
1 change: 0 additions & 1 deletion MANIFEST
Original file line number Diff line number Diff line change
Expand Up @@ -3662,7 +3662,6 @@ dist/Storable/t/code.t See if Storable works
dist/Storable/t/compat01.t See if Storable works
dist/Storable/t/compat06.t See if Storable works
dist/Storable/t/croak.t See if Storable works
dist/Storable/t/CVE-2015-1592.inc See if Storable works
dist/Storable/t/CVE-2015-1592.t See if Storable works
dist/Storable/t/dclone.t See if Storable works
dist/Storable/t/destroy.t Test Storable in global destructon
Expand Down
261 changes: 0 additions & 261 deletions dist/Storable/t/CVE-2015-1592.inc

This file was deleted.

25 changes: 12 additions & 13 deletions dist/Storable/t/CVE-2015-1592.t
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
#!/usr/bin/perl

use strict;
use warnings;
use Test::More;
use Storable qw(freeze thaw);
plan tests => 1;

use File::Temp qw(tempdir);
use File::Spec;
my $tmp_dir = tempdir(CLEANUP => 1);
my $tmp_file = File::Spec->catfile($tmp_dir, 'sploit');
# this original worked with the packaged exploit, but that
# triggers virus scanners, so test for the behaviour instead
my $x = bless \(my $y = "mt-config.cgi"), "CGITempFile";

my $frozen = freeze($x);

my $file = __FILE__;
$file =~ s/\.t$/.inc/;
my $inc = $ENV{PERL_CORE} ? "-Ilib -I../../lib" : "-I".join(" -I", @INC);
system qq($^X $inc -w "$file" 2>$tmp_file);
open(my $fh, "<", $tmp_file) or die "$tmp_file $!";
{
local $/;
my $err = <$fh>;
like($err, qr/SECURITY: Movable-Type CVE-2015-1592 Storable metasploit attack/,
'Detect CVE-2015-1592');
my $warnings = '';
local $SIG{__WARN__} = sub { $warnings .= "@_" };
thaw($frozen);
like($warnings, qr/SECURITY: Movable-Type CVE-2015-1592 Storable metasploit attack/,
'Detect CVE-2015-1592');
}

0 comments on commit fb5f378

Please sign in to comment.