Skip to main content
Live Webinar with SANS (June 25)— Agentic CTI Automation for Fun & ProfitRegister Free
Mallory
MediumPublic exploit

PuTTY NIST P-521 ECDSA Biased Nonce Private Key Recovery

IdentifiersCVE-2024-31497CWE-335

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.

Share:
For your environment

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.

ANALYST BRIEF

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.

Successful exploitation allows recovery of the victim's NIST P-521 ECDSA private key. Once the private key is recovered, an attacker can impersonate the victim for SSH authentication, gain unauthorized access to other systems or services that trust the same key, and produce valid signatures as the victim. In Git-related workflows, this can enable maintainer impersonation and software supply-chain attacks through forged signed commits or related actions. The compromise persists even after software is patched if the attacker already collected enough vulnerable signatures, so previously used keys must be treated as compromised.

Mitigation

If you can’t patch tonight, do this now.

Do not use NIST P-521 ECDSA keys with vulnerable PuTTY-based software. Until upgrades and key replacement are complete, avoid exposing signatures to untrusted parties, avoid authenticating to untrusted SSH servers with affected keys, and avoid using affected keys for public signing workflows such as SSH-based Git commit signing, especially through agent forwarding. Limit reuse of the same SSH key across multiple services to reduce cross-service impact if one key is compromised. Monitor for suspicious use of affected keys and rotate them immediately if exposure is suspected.

Remediation

Patch, then assume compromise.

Upgrade PuTTY to 0.81 or later. Upgrade affected downstream products to fixed releases: FileZilla 3.67.0 or later, WinSCP 6.3.3 or later, and TortoiseGit 2.15.0.1 or later. For TortoiseSVN, use Plink from PuTTY 0.81 for SVN-over-SSH until a native fix is available. Revoke and replace any NIST P-521 ECDSA keys that were used with vulnerable versions, including removing affected public keys from authorized_keys and from services such as Git hosting platforms. Because key recovery may remain possible from signatures already collected before patching, patching alone is insufficient without key rotation.
PUBLIC EXPLOITS

Exploits

1 valid exploit after Mallory filtered fakes, detection scripts, and README-only repos (1 hidden).

VALID 1 / 2 TOTALView more in app
CVE-2024-31497-POCMaturityPoCVerified exploit

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.

HugoBondDisclosed May 10, 2024pythonlocalnetwork
EXPOSURE SURFACE

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.

VendorProductType
Fedora ProjectFedoraoperating_system
Filezilla-ProjectFilezilla Clientapplication
PuttyPuttyapplication
TigrisTortoisesvnapplication
TortoisegitTortoisegitapplication
WinscpWinscpapplication

Vendor-confirmed product mapping. Mallory continuously reconciles this list against your asset inventory.

What this page doesn’t show

The version that knows your environment.

This page is what’s public. Mallory adds the parts that aren’t: which of your assets are affected, which adversaries are exploiting it right now, which detections to deploy, and what to do tonight.
Exposure mapping

Query your assets running an affected version, and investigate the blast radius.

Threat actor evidence

Every observed campaign linking this CVE to a named adversary.

Associated malware

Malware families riding this exploit, with evidence and IOCs.

Detection signatures

YARA, Sigma, Snort, and vendor rules, auto-deployed to your SIEM.

Vendor-by-vendor mapping

Cross-references every affected SKU, including bundled OEM variants.

Social activity3

Community discussion across Reddit, Mastodon, and other social sources.