PuTTY NIST P-521 ECDSA Biased Nonce Private Key Recovery
PuTTY 0.68 through 0.80, before 0.81, contains a cryptographic flaw in ECDSA nonce generation for NIST P-521 keys. The implementation produces heavily biased nonces, reported as having the first 9 bits of each nonce set to zero, which breaks the expected unpredictability of the per-signature nonce. Given approximately 60 valid ECDSA signatures generated with the same affected P-521 private key, an attacker can apply practical lattice-based techniques to recover the private key. The issue affects PuTTY and related components such as Pageant, and also impacts products that bundle the vulnerable PuTTY code paths, including FileZilla before 3.67.0, WinSCP before 6.3.3, TortoiseGit before 2.15.0.1, and TortoiseSVN through 1.14.6. The vulnerability is especially dangerous where signatures are observable by an adversary, such as signatures collected by a malicious SSH server during client authentication or publicly readable signatures from SSH-based Git commit signing via agent forwarding.
Are you exposed to this one?
Mallory correlates every CVE against your assets, your vendors, and active adversary campaigns. Know which vulnerabilities matter for you, not just which ones are loud.
Impact, mitigation & remediation
What it means. What to do now. Patch path, mitigations, and the assume-compromise checklist.
Impact
What an attacker gets, and what they’ve been doing with it.
Mitigation
If you can’t patch tonight, do this now.
Remediation
Patch, then assume compromise.
Exploits
1 valid exploit after Mallory filtered fakes, detection scripts, and README-only repos (1 hidden).
This repository is a proof-of-concept (POC) exploit for CVE-2024-31497, a vulnerability in the ECDSA nonce generation of PuTTY and TortoiseGit (ecc-ssh.c). The exploit leverages the bias in the nonce (top 9 bits zeroed) to recover the ECDSA private key using lattice-based cryptanalysis (Hidden Number Problem). The repository is structured as follows: - 'main.py' is the main entry point, taking as input a file of ECDSA signatures and a public key, and attempts to recover the private key, saving it to disk if successful. - 'attack/ecdsa_hnp.py' contains the core cryptanalytic logic for solving the Hidden Number Problem with biased ECDSA nonces. - 'attack/exploit.py' provides functions for key export and public key reading. - 'attack/usvp.py' and 'attack/utils.py' provide supporting cryptanalytic and utility functions. - 'test.py' is a test harness that generates test signatures and validates the attack. - 'test/signatures.txt' and 'test/pubkey.pub' are sample input files. The exploit requires at least 58-60 ECDSA signatures generated by a vulnerable implementation and the corresponding public key. It does not target a network service directly, but the README describes two attack surfaces: collecting signatures from signed GitHub commits or by running a rogue SSH server to collect signatures from clients using the vulnerable software. The exploit is a POC and does not include weaponized automation for signature collection, but demonstrates full private key recovery from collected data.
Affected products & vendors
Products and vendors Mallory has correlated with this vulnerability. Open in Mallory to drill down to specific CPE configurations and version ranges.
Vendor-confirmed product mapping. Mallory continuously reconciles this list against your asset inventory.
Recent activity
8 sources tracked across advisories, community write-ups, and news. New activity surfaces here as Mallory finds it.
An ECDSA nonce vulnerability referenced as a similar class example in the article's resource section.
A vulnerability in PuTTY (CVE-2024-31497) allows attackers to recover SSH keys, aiding persistence and lateral movement in compromised environments.
A cryptographic flaw in PuTTY/Pageant where biased ECDSA nonce generation for NIST P-521 can allow private key recovery from a relatively small number of observed signatures, enabling subsequent unauthorized access and potential supply-chain compromise (e.g., via signed Git commits).
A cryptographic vulnerability in PuTTY’s ECDSA (NIST P-521) nonce generation where nonces are biased (first 9 bits zero), enabling lattice-based recovery of the ECDSA private key after observing ~60 signatures produced under the same key.
The version that knows your environment.
Query your assets running an affected version, and investigate the blast radius.
Every observed campaign linking this CVE to a named adversary.
Malware families riding this exploit, with evidence and IOCs.
YARA, Sigma, Snort, and vendor rules, auto-deployed to your SIEM.
Cross-references every affected SKU, including bundled OEM variants.
Community discussion across Reddit, Mastodon, and other social sources.