This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
(perl #133706) remove exploit code from Storable
[perl5.git] / dist / Storable / t / CVE-2015-1592.t
CommitLineData
fc10c8b7
RU
1#!/usr/bin/perl
2
3use strict;
fb5f378b 4use warnings;
fc10c8b7 5use Test::More;
fb5f378b 6use Storable qw(freeze thaw);
fc10c8b7
RU
7plan tests => 1;
8
fb5f378b
TC
9# this original worked with the packaged exploit, but that
10# triggers virus scanners, so test for the behaviour instead
11my $x = bless \(my $y = "mt-config.cgi"), "CGITempFile";
12
13my $frozen = freeze($x);
fc10c8b7 14
fc10c8b7 15{
fb5f378b
TC
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');
fc10c8b7 21}