PuTTY vulnerability can be exploited to recover private keys (CVE-2024-31497)
Vulnerabilities mentionedAll →
| CVE | Vulnerability | CVSS | EPSS | Flags | Affected | Exposure | Published |
|---|---|---|---|---|---|---|---|
| CVE-2024-31497 | In PuTTY 0.68 through 0.80 before 0.81, biased ECDSA nonce generation allows an attacker to recover a user's NIST P-521 secret key via a quick attack in approxi In PuTTY 0.68 through 0.80 before 0.81, biased ECDSA nonce generation allows an attacker to recover a user's NIST P-521 secret key via a quick attack in approximately 60 signatures. This is especially important in a scenario where an adversary is able to read messages signed by PuTTY or Pageant. The required set of signed messages may be publicly readable because they are stored in a public Git service that supports use of SSH for commit signing, and the signatures were made by Pageant through an agent-forwarding mechanism. In other words, an adversary may already have enough signature information to compromise a victim's private key, even if there is no further use of vulnerable PuTTY versions. After a key compromise, an adversary may be able to conduct supply-chain attacks on software maintained in Git. A second, independent scenario is that the adversary is an operator of an SSH server to which the victim authenticates (for remote login or file copy), even though this server is not fully trusted by the victim, and the victim uses the same private key for SSH connections to other services operated by other entities. Here, the rogue server operator (who would otherwise have no way to determine the victim's private key) can derive the victim's private key, and then use it for unauthorized access to those other services. If the other services include Git services, then again it may be possible to conduct supply-chain attacks on software maintained in Git. This also affects, for example, FileZilla before 3.67.0, WinSCP before 6.3.3, TortoiseGit before 2.15.0.1, and TortoiseSVN through 1.14.6. NVD description · AI analysis pending | 5.9 | 6% |
| — |
Full article445 words · extracted from helpnetsecurity.com · click to collapse
A vulnerability (CVE-2024-31497) in PuTTY, a popular SSH and Telnet client, could allow attackers to recover NIST P-521 client keys due to the “heavily biased” ECDSA nonces (random values used once), researchers have discovered.

“To be more precise, the first 9 bits of each ECDSA nonce are zero. This allows for full secret key recovery in roughly 60 signatures by using state-of-the-art techniques,” Fabian Bäumer shared on the oss-sec mailing list.
According to PuTTY maintainers, 521-bit ECDSA is the only affected key type. “Other sizes of ECDSA, and other key algorithms, are unaffected. In particular, Ed25519 is not affected,” they said.
What’s the big deal about CVE-2024-31497?
The vulnerability was discovered by Bäumer and Marcus Brinkmann, researchers with Ruhr-Universität Bochum. (Bäumer and Brinkmann were also behind last year’s discovery of Terrapin, a prefix truncation attack targeting the SSH protocol.)
CVE-2024-31497 allows an attacker that knows the public key and around 60 valid ECDSA signatures generated by any PuTTY component under the same key to derive the private key, which they can then use to log into any SSH servers that key is used for.
To obtain these signatures, an attacker may compromise a server the user repeatedly authenticates to.
“If the key has been used to sign arbitrary data (e.g., git commits by forwarding Pageant [an SSH authentication agent for PuTTY] to a development host), the publicly available signatures (e.g., on GitHub) can be used as well,” Bäumer noted.
The vulnerability affects PuTTY v0.68 to 0.80, as well as other software that come bundled with an affected PuTTY version:
- FileZilla 3.24.1 – 3.66.5
- WinSCP 5.9.5 – 6.3.2
- TortoiseGit 2.4.0.2 – 2.15.0
- TortoiseSVN 1.10.0 – 1.14.6
What to do?
The vulnerability has been fixed in PuTTY v0.81 by switching to the RFC 6979 technique for DSA nonce generation, and the maintainers explained why the switch wasn’t made earlier.
But, as Bäumer pointed out, all NIST P-521 client keys used with PuTTY must be considered compromised and should be revoked.
“Remove the old public key from all OpenSSH authorized_keys files, and the equivalent in other SSH servers, so that a signature from the compromised key has no value any more. Then generate a new key pair to replace it,” PuTTY maintainers advised.
CVE-2024-31497 has also been fixed in FileZilla v3.67.0, WinSCP v6.3.3, and TortoiseGit v2.15.0.1. TortoiseSVN users should configure it to use Plink from PuTTY v0.81 when accessing a SVN repository via SSH until a patch becomes available.
UPDATE (May 13, 2024, 05:45 a.m. ET):
A PoC for CVE-2024-31497 has been released.
Citrix advised XenCenter admins to mitigate the flaw by either removing the PuTTY component completely or replace it with an updated version.
Text extracted automatically; images, tables and formatting may be missing. Original: https://www.helpnetsecurity.com/2024/04/16/cve-2024-31497/