Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 472428 (CVE-2013-2145)

Summary: <dev-perl/Module-Signature-0.720.0: Arbitrary code execution when verifying SIGNATURE (CVE-2013-2145)
Product: Gentoo Security Reporter: Agostino Sarubbo <ago>
Component: VulnerabilitiesAssignee: Gentoo Security <security>
Status: RESOLVED FIXED    
Severity: normal CC: perl
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
URL: https://bugzilla.redhat.com/show_bug.cgi?id=971096
Whiteboard: B2 [glsa]
Package list:
Runtime testing required: ---

Description Agostino Sarubbo gentoo-dev 2013-06-05 16:58:17 UTC
From ${URL} :

The perl Module::Signature module adds signing capabilities to CPAN modules.  The 'cpansign verify' command will automatically download keys and use 
them to check the signature of CPAN packages via the SIGNATURE file.

The format of the SIGNATURE file includes the cipher to use to match the provided hash; for instance:

SHA1 955ba924e9cd1bafccb4d6d7bd3be25c3ce8bf75 README

If an attacker were to replace this (SHA1) with a special unknown cipher (e.g. 'Special') and were to include in the distribution a 
'Digest/Special.pm', the code in this perl module would be executed when 'cpansign -verify' is run.  This will execute arbitrary code with the 
privileges of the user running cpansign.

Because cpansign will download public keys from a public key repository, the GPG key used to sign the SIGNATURE file may also be suspect; an attacker 
able to modify a CPAN module distribution file and sign the SIGNATURE file with their own key only has to make their key public.  cpansign will 
download the attacker's key, validate the SIGNATURE file as being correctly signed, but will then execute code as noted above, if the SIGNATURE file 
is crafted in this way.

Module::Signature version 0.72 corrects [1],[2] this issue by refusing to load Digest::* modules from relative paths in @INC.

[1] https://github.com/audreyt/module-signature/commit/575f7bd6ba4cc7c92f841e8758f88a131674ebf2
[2] https://github.com/audreyt/module-signature/commit/cbd06b392a73c63159dc5c20ff5b3c8fc88c4896


@maintainer(s): after the bump, in case we need to stabilize the package, please say explicitly if it is ready for the stabilization or not.
Comment 1 Sergey Popov gentoo-dev 2013-08-20 10:58:31 UTC
+  20 Aug 2013; Sergey Popov <pinkbyte@gentoo.org>
+  +Module-Signature-0.730.0.ebuild:
+  Version bump, wrt bug #472428

Arches, please test and mark stable =dev-perl/Module-Signature-0.730.0

Target keywords: amd64 x86
Comment 2 Mikle Kolyada (RETIRED) archtester Gentoo Infrastructure gentoo-dev Security 2013-08-21 11:07:08 UTC
amd64/x86 stable
Comment 3 Sergey Popov gentoo-dev 2013-08-21 11:14:33 UTC
Thanks for your work

New GLSA request filed
Comment 4 GLSAMaker/CVETool Bot gentoo-dev 2013-08-30 10:01:45 UTC
CVE-2013-2145 (http://nvd.nist.gov/nvd.cfm?cvename=CVE-2013-2145):
  The cpansign verify functionality in the Module::Signature module before
  0.72 for Perl allows attackers to bypass the signature check and execute
  arbitrary code via a SIGNATURE file with a "special unknown cipher" that
  references an untrusted module in Digest/.
Comment 5 GLSAMaker/CVETool Bot gentoo-dev 2013-10-04 07:21:47 UTC
This issue was resolved and addressed in
 GLSA 201310-01 at http://security.gentoo.org/glsa/glsa-201310-01.xml
by GLSA coordinator Sergey Popov (pinkbyte).