Get all your news in one place.
100’s of premium titles.
One app.
Start reading
TechRadar
TechRadar
Sead Fadilpašić

Security flaw in top SSH client could let hackers recover cryptographic private keys

A computer being guarded by cybersecurity.

Multiple versions of the PuTTY SSH client were found to be vulnerable to a high-severity flaw which allowed, in certain scenarios, threat actors to exfiltrate private keys used to generate cryptographic signatures. 

As a result, the attackers could gain unauthorized access to SSH servers, or could be allowed to sign commits as a developer. 

As reported by BleepingComputer, the vulnerability in versions PuTTY versions 0.68 to 0.80 is tracked as CVE-2024-31497, and affects at least these software:

FileZilla 3.24.1 – 3.66.5 (fixed in 3.67.0)
WinSCP 5.9.5 – 6.3.2 (fixed in 6.3.3)
TortoiseGit 2.4.0.2 – 2.15.0 (fixed in 2.15.0.1)
TortoiseSVN 1.10.0 – 1.14.6 (mitigation possible by configuring TortoiseSVN to use Plink from the latest PuTTY 0.81 release)

There could be others, the researchers warned, depending on the version of PuTTY used, urging users to double-check their tools.

Needing signatures

The researchers who discovered the flaw are Fabian Bäumer and Marcus Brinkmann of the Ruhr University Bochum. PuTTY is a free, open-source terminal emulator, serial console, and network file transfer application. It supports different network protocols, such as SCP, SSH, Telnet, and others. It can also connect to a serial port. 

Companies typically use the service to access and manage servers, and other network-connected devices, remotely, over SSH. 

The problem, as the researchers explained, stems from how PUTTY generates ECDSA nonces for the NIST P-521 curve, used for SSH authentication:

"PuTTY's technique worked by making a SHA-512 hash and then reducing it mod q, where q is the order of the group used in the DSA system. For integer DSA (for which PuTTY's technique was originally developed), q is about 160 bits; for elliptic-curve DSA (which came later), it has about the same number of bits as the curve modulus, so 256 or 384 or 521 bits for the NIST curves," they said.

"In all of those cases except P521, the bias introduced by reducing a 512-bit number mod q is negligible. But in the case of P521, where q has 521 bits (i.e. more than 512), reducing a 512-bit number mod q has no effect at all – you get a value of k whose top 9 bits are always zero."

The only caveat here is that the attackers need 58 signatures to be able to calculate their target’s private key. The best way to do that, it was said, was through Git commits. Git can be configured to use OpenSSH to sign Git commits with the SSH key provided by Pageant.

The ssh-agent of PuTTY then generates the signature, which can then be recovered. Version 0.81 addressed the flaw.

More from TechRadar Pro

Sign up to read this article
Read news from 100’s of titles, curated specifically for you.
Already a member? Sign in here
Related Stories
Top stories on inkl right now
One subscription that gives you access to news from hundreds of sites
Already a member? Sign in here
Our Picks
Fourteen days free
Download the app
One app. One membership.
100+ trusted global sources.