Executive brief
Crypt::DSA is a Perl library used to generate digital signatures for verifying the authenticity of data. A flaw in how the library generates random numbers means that the secret keys used for these signatures are not truly random. An attacker who observes a small number of signatures can use mathematical techniques to recover the private key, allowing them to forge signatures or impersonate the legitimate owner.
Technical details
The Crypt::DSA::Util::makerandom function, used for generating both the DSA signing nonce (k) and the private key, contains a modulo bias. Specifically, the function forces the high bit of every returned value to be set to ensure an exactly N-bit integer for prime searches. This lack of uniformity results in a fixed top bit, producing insecure values. An attacker who collects a modest number of signatures (potentially hundreds) generated with an affected key can perform a lattice-based attack to recover the full private key. Users should upgrade to version 1.22 and generate new keys, as existing keys generated or used with vulnerable versions are compromised.
Affected products
- TIMLEGGE (CPAN) Crypt::DSA < 1.22
Timeline
- 2026-07-03: patched: Version 1.22 released to fix the bias issue.
- 2026-07-05: disclosed: CVE-2026-14570 published.