Executive brief
A security flaw in the Crypt::DSA Perl library allows attackers to recover a user's private encryption key. This occurs because the library incorrectly reuses a secret number (nonce) when creating digital signatures, which is a fundamental cryptographic error. If a private key was used to sign more than one document using an affected version of this software, that key must be considered stolen and should be revoked immediately.
Technical details
The Crypt::DSA::sign function in versions prior to 1.21 caches the per-signature nonce material (k) within the Key object and fails to clear or regenerate it for subsequent operations. As a result, the first call to sign() generates a nonce that is reused for every subsequent signature made with that same object, producing an identical 'r' value. In DSA, reusing a nonce across different messages allows an observer to mathematically derive the private key. This is classified as CWE-323 (Reusing a Nonce). Users should upgrade to version 1.21, which ensures a fresh nonce is generated for every signature, and revoke any keys used with vulnerable versions.
Affected products
- Perl CPAN Crypt::DSA < 1.21
Timeline
- 2026-05-16: other: Maintainer contacted
- 2026-06-14: patched: Version 1.21 released
- 2026-06-15: disclosed: Public advisory released