Anyone can reassemble an OpenPGP certificate into a different order.
The two attached OpenPGP certificates contain the same OpenPGP packets, but the user IDs are present in a different order:
But importing them into clean GnuPG homedirs shows different primary key validity and different primary key usage flags:
$ for x in alice alice-reordered ; do mkdir -m 0700 $x; gpg --homedir=$x --import $x.key; gpg --homedir=$x --list-keys; done gpg: keybox '/home/dkg/alice/pubring.kbx' created gpg: /home/dkg/alice/trustdb.gpg: trustdb created gpg: key 3CB7A19683B428D1: public key "<alice.jones@example.com>" imported gpg: Total number processed: 1 gpg: imported: 1 /home/dkg/alice/pubring.kbx ------------------------------------------------------------ pub rsa3072 2020-03-12 [C] [expires: 2025-03-11] 7138FE5EB6895581ED99E3AD3CB7A19683B428D1 uid [ unknown] <alice.jones@example.com> uid [ unknown] <alice@example.net> sub rsa3072 2020-03-12 [E] gpg: keybox '/home/dkg/alice-reordered/pubring.kbx' created gpg: /home/dkg/alice-reordered/trustdb.gpg: trustdb created gpg: key 3CB7A19683B428D1: public key "<alice.jones@example.com>" imported gpg: Total number processed: 1 gpg: imported: 1 /home/dkg/alice-reordered/pubring.kbx ---------------------------------------------------------------------- pub rsa3072 2020-03-12 [SC] [expires: 2022-03-12] 7138FE5EB6895581ED99E3AD3CB7A19683B428D1 uid [ unknown] <alice.jones@example.com> uid [ unknown] <alice@example.net> sub rsa3072 2020-03-12 [E] $
I'm not clever or malicious enough see an immediate attack vector in this ambiguity, but i can certainly imagine it being an accidental maintenance problem.
For example, imagine Bob and Carol both have Alice's certificate, but Bob received alice.key and Carol received alice-reordered.key.
On 2022-03-13, Carol says to Bob "hey, do you have Alice's OpenPGP certificate, my copy is expired". Bob says "sure, the copy i've got is good for a few more years, here you go." Carol imports Bob's copy, but her expiration date doesn't change.
Outside of Alice, Bob, and Carol, this makes me worry about the sustainability of the review process for critical keyrings, like the debian keyring.
(i discovered the above while writing up a suggestion for a new test for an OpenPGP linter)