Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pkey: __eq__() should not use hash()
... because `hash()` is too weak and not intended for this. Also simplify `__cmp__()` (which did work fine). This fixes a security flaw. If you are using Paramiko with Python 2, or a Python 3 which is running with PYTHONHASHSEED=0, it is possible for an attacker to craft a new keypair from an exfiltrated public key, which Paramiko would consider equal to the original key. This could enable attacks such as: * Paramiko server processes would incorrectly authenticate the attacker (using their generated private key) as if they were the victim. * Paramiko client processes would incorrectly validate a connected server (when host key verification is enabled) while subjected to a man-in-the-middle attack. This impacts more users than the server-side version, but also carries higher requirements for the attacker, namely successful DNS poisoning or other MITM techniques. Reported by @jun66j5 in paramiko#908 Vulnerability description by Jeff Forcier <jeff@bitprophet.org>
- Loading branch information