Historical bug tracker for the Pacman package manager.
The pacman bug tracker has moved to gitlab:
https://gitlab.archlinux.org/pacman/pacman/-/issues
This tracker remains open for interaction with historical bugs during the transition period. Any new bugs reports will be closed without further action.
The pacman bug tracker has moved to gitlab:
https://gitlab.archlinux.org/pacman/pacman/-/issues
This tracker remains open for interaction with historical bugs during the transition period. Any new bugs reports will be closed without further action.
FS#45461 - pacman-key: add --keyid-format option
Attached to Project:
Pacman
Opened by Sebastian Pipping (sping) - Wednesday, 24 June 2015, 21:35 GMT
Last edited by Allan McRae (Allan) - Sunday, 04 December 2022, 08:20 GMT
Opened by Sebastian Pipping (sping) - Wednesday, 24 June 2015, 21:35 GMT
Last edited by Allan McRae (Allan) - Sunday, 04 December 2022, 08:20 GMT
|
DetailsNote: bug title changed based on comment https://bugs.archlinux.org/task/45461#comment136997
Original report: Hi! In the output of `pacman-key --list-sigs` I noticed that short key IDs are display rather than long ones or full fingerprints. It could be easy to fix by adjusting the call to GPG from pacman-key. I wonder if there are more places where short key IDs are used in pacman-key. To summarize my concern with using short key IDs, I would like to quote from <http://www.asheesh.org/note/debian/short-key-ids-are-bad-news.html>: "It is important that we [..] stop using short key IDs. There is no vulnerability in OpenPGP and GPG. However, using short key IDs (like 0x70096AD1) is fundamentally insecure; it is easy to generate collisions for short key IDs. We should always use 64-bit (or longer) key IDs, like: 0x37E1C17570096AD1 or 0xEC4B033C70096AD1." Are there plans to move to long key IDs, already? Thanks and best, Sebastian |
This task depends upon
Closed by Allan McRae (Allan)
Sunday, 04 December 2022, 08:20 GMT
Reason for closing: Won't implement
Additional comments about closing: Justification for inclusion is not clear, and you can use gpg directly with --homedir to achieve this if really wanted
Sunday, 04 December 2022, 08:20 GMT
Reason for closing: Won't implement
Additional comments about closing: Justification for inclusion is not clear, and you can use gpg directly with --homedir to achieve this if really wanted
This isn't nearly the issue you claim, and not an attack at all. It's well-known, and people have created 32-bit collisions for probably about 20 years now. However, even going back to PGP's early days, the software dealt with 64-bit key ids, and software in general does the right thing.
Stephen Paul Weber above points out correctly that if you ever get stuck with with the wrong key, signatures won't be valid, encryption won't work, etc. As he says, it can cause nothing worse than confusion.
In the example you give yourself, GPG does the correct thing! There are now two keys on the MIT key server with the same truncated key id, but they have different 64-bit key IDs. GPG goes and gets both keys, which is exactly what it should be doing.
If you create a key with a 32-bit collision to PRZ's, Werner's, mine, or whomever's, nothing bad will happen. You cannot forge a signature, you cannot mis-encrypt. Sorry, you're wrong on that. Nothing bad will happen. If you don't believe me, try it.
Lastly, both RFC 2440 and RFC 4480 say:
A Key ID is an eight-octet scalar that identifies a key. Implementations SHOULD NOT assume that Key IDs are unique.
and
Note that it is possible for there to be collisions of Key IDs -- two different keys with the same Key ID. Note that there is a much smaller, but still non-zero, probability that two different keys have the same fingerprint.
Yes, you're right that the user experience of a command-line program that allows you to type in a subset of a 64-bit number can lead to confusion -- you got led there. But it's not an attack and not a security problem.
Regards,
Jon, OpenPGP co-author and co-founder of PGP.
The connection to the key server is not secure so it can be man-in-the-middled and I could get a fake key with the same short ID, only. Right?
Also, many users of GPG have not yet heard of the problem and could use help from pacman-key by not being presented short key IDs.
Asking for a non-unique short ID will lead to GPG retrieving all keys with that short ID. If your connection is MITM'd, the contents of the keyserver are irrelevant, as the attacker can inject any arbitrary response.
"If you create a key with a 32-bit collision to PRZ's, Werner's, mine, or whomever's, nothing bad will happen. You cannot forge a signature, you cannot mis-encrypt. Sorry, you're wrong on that. Nothing bad will happen. If you don't believe me, try it."
So even if a MITM gives you a matching key, nothiing bad will happen.
I will accept a patch that add the --keyid-format option to pacman-key and passes it on to the gpg command.