Socat slams backdoor, sparks thrilling whodunit

Year-old bug ruined crypto

Popular admin tool Socat has issued a patch for an error that's been in the code for 12 months and is so egregious some fear it could be a backdoor.

The problem, revealed here, is simple: the Socat SSL implementation uses a non-prime number as its Diffie-Hellman p parameter.

Socat is akin to the famous *nix cat command, but it's able to pipe results to and from network addresses (which is why security is essential).

As Openwall's post states: "... since there is no indication of how these parameters were chosen, the existence of a trapdoor that makes it possible for an eavesdropper to recover the shared secret from a key exchange that uses them cannot be ruled out."

Over at Hacker News, people have already started playing with the p parameter, and turned up pretty quickly that it's divisible by 271 and 13,597. The Hacker News discussion rules out a simple typo, because nobody has so far found a nearby number that is prime.

The change that introduced the vulnerability is attributed to a Chinese developer working for Oracle, Zhigang Wang, who offered the fix in this January 2015 commit.

At the time, Socat developer Gerhard Rieger said the commit was made because "Socat did not work in FIPS mode because 1024 instead of 512 bit DH prime is required. Thanks to Zhigang Wang for reporting and sending a patch."

Hacker News commenters are also complaining that the number should have been tested for primeness before the commit was allowed.

If there's some reason you can't use the patched code (linked in the Openwall post), Diffie-Hellman ciphers should be disabled for now.

Along with everyone else, The Register has contacted Zhigang Wang for comment. ®


Here's the offending non-prime number:


Obvious, really.