Friday, September 13. 2019
Security Issues with PGP Signatures and Linux Package Management
Comments
Display comments as
(Linear | Threaded)
those are known issues with OpenPGP key management in general and APT security in particular. I wish efforts were made everywhere in the ecosystem (including APT upstream but particularly third-party repositories) to improve this.
I have made a document that includes a set of recommendations for this, which I am now thinking I should turn into a DEP:
https://help.torproject.org/tsa/howto/upgrades/buster/
do you feel it would address the issues you identified here?
thanks
I have made a document that includes a set of recommendations for this, which I am now thinking I should turn into a DEP:
https://help.torproject.org/tsa/howto/upgrades/buster/
do you feel it would address the issues you identified here?
thanks
rah, wrong link sorry, it should be:
https://wiki.debian.org/DebianRepository/UseThirdParty
https://wiki.debian.org/DebianRepository/UseThirdParty
These are somewhat known issues, yet I think you'd find it a little bit more difficult to make a working PoC ;)
Something you don't mention here is that you not only need to MitM the key delivery mechanism, you would also have to make sure you not only collide the keyid but also the positive certification signature, that hashes the *whole pubkey packet + the keyd* as of RFC4880:
https://tools.ietf.org/html/rfc4880#section-5.2.4
i.e., the keyid is a key lookup mechanism, not where trust is ultimately rooted.
As for attacking external repositories, yeah that may be an issue.
Something you don't mention here is that you not only need to MitM the key delivery mechanism, you would also have to make sure you not only collide the keyid but also the positive certification signature, that hashes the *whole pubkey packet + the keyd* as of RFC4880:
https://tools.ietf.org/html/rfc4880#section-5.2.4
i.e., the keyid is a key lookup mechanism, not where trust is ultimately rooted.
As for attacking external repositories, yeah that may be an issue.
> you would also have to make sure you not only collide the keyid but also the positive certification signature, that hashes the *whole pubkey packet + the keyd* as of RFC4880:
I don't think that's correct. You would not try to collide that signature hash, you'd just recreate the signature. That signature is not part of the hash that makes up the key id.
The way you'd actually do it is to collide the key id, e.g. by iterating over various values of e, and then create a fully working private key.
I don't think that's correct. You would not try to collide that signature hash, you'd just recreate the signature. That signature is not part of the hash that makes up the key id.
The way you'd actually do it is to collide the key id, e.g. by iterating over various values of e, and then create a fully working private key.
> I don't think that's correct. You would not try to collide that signature hash, you'd just recreate the signature. That signature is not part of the hash that makes up the key id.
What you need to re-create the signature would be to replace the key that gave it trust certification then. You'd have to walk up the certification chain to have *that* key validated.
You're right that the signature is not part of the hash that makes up the key id. But the positive certification signature (that is, the one that marks the key as trusted) is computed using a hash over the whole pubkey packet and the keyid, not just signing the user id (or the keyid for that matter). If you want gpg to trust your collided-keyid-key there needs to be a trusted key to have a positive certification signature over such key.
> The way you'd actually do it is to collide the key id, e.g. by iterating over various values of e, and then create a fully working private key.
This is actually easier to do. You can try to collide the keyid by changing the creation date (a 32-bit value, also subjected to 2038 problem btw). Throw in the birthday paradox and you probably need just a couple of keys to try to collide the long keyid...
What you need to re-create the signature would be to replace the key that gave it trust certification then. You'd have to walk up the certification chain to have *that* key validated.
You're right that the signature is not part of the hash that makes up the key id. But the positive certification signature (that is, the one that marks the key as trusted) is computed using a hash over the whole pubkey packet and the keyid, not just signing the user id (or the keyid for that matter). If you want gpg to trust your collided-keyid-key there needs to be a trusted key to have a positive certification signature over such key.
> The way you'd actually do it is to collide the key id, e.g. by iterating over various values of e, and then create a fully working private key.
This is actually easier to do. You can try to collide the keyid by changing the creation date (a 32-bit value, also subjected to 2038 problem btw). Throw in the birthday paradox and you probably need just a couple of keys to try to collide the long keyid...
Tracked: Sep 13, 20:46