Page MenuHome GnuPG

Retrieving a key with --recv-key should verify the received key matches the key ID.
Closed, ResolvedPublic

Description

I setup a server to mimic a key server and return a plain text file from
pks/lookup. I then added a random public key to the lookup file. I then
requested an different key from the command line using "gpg --keyserver
hkp://localhost --recv-keys 0xFBB75451". To my surprise, the fake key imported
without error. Ideally, GnuPG should check the returned key's fingerprint
against the fingerprint being requested. If the fingerprints do not match, the
import should fail.

Since key server communication is not encrypted, an adversary can easily reply
with a fake key and intercept subsequent encrypted communication.

Details

Version
1.4.16

Event Timeline

werner added a subscriber: werner.

No, he can't. The data received from a keyserver is by defintion unreliable.
It may be any kind of trash. gpg takes care of ensuring that the data (i.e. the
keys) are consistent.

There has been a long and heated debate over this recently on whether the
additional check introduced with 1.4.18 is at all useful. In any case what you
requested is in all recent versions of gpg. I thus close this bug.

werner claimed this task.