CVE-2013-2145: Input Validation
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/.
Other sources
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
Acknowledgements:
This issue was discovered by Florian Weimer of the Red Hat Product Security Team.
— Red Hat
Affected Software
Remediation
Event History
Frequently Asked Questions
What is the severity of CVE-2013-2145?
CVE-2013-2145 is classified as a critical vulnerability due to its potential to allow attackers to execute arbitrary code.
How do I fix CVE-2013-2145?
To remediate CVE-2013-2145, update the perl-Module-Signature module to version 0.72 or later.
Which versions of Perl are affected by CVE-2013-2145?
CVE-2013-2145 affects versions of the Module::Signature module prior to 0.72.
What is the nature of the vulnerability in CVE-2013-2145?
The vulnerability in CVE-2013-2145 allows signature verification bypass via a manipulated SIGNATURE file.
Is CVE-2013-2145 related to specific operating systems?
CVE-2013-2145 affects various systems including specific versions of Ubuntu and openSUSE.