Security Issues with PGP Signatures and Linux Package Management

Hanno's Blog

Friday, September 13. 2019

Security Issues with PGP Signatures and Linux Package Management


Trackbacks

Weblog: techrights.org
Tracked: Sep 13, 20:46

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
#1 anarcat (Homepage) on 2019-09-13 15:06 (Reply)
rah, wrong link sorry, it should be:

https://wiki.debian.org/DebianRepository/UseThirdParty
#1.1 anarcat (Homepage) on 2019-09-13 15:07 (Reply)
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.
#2 Santiago Torres on 2019-09-13 17:55 (Reply)
> 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.
#2.1 Hanno (Homepage) on 2019-09-16 10:32 (Reply)
> 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...
#3 Santiago Torres-Arias on 2019-09-17 21:38 (Reply)

Add Comment

E-Mail addresses will not be displayed and will only be used for E-Mail notifications.

To prevent automated Bots from commentspamming, please enter the string you see in the image below in the appropriate input box. Your comment will only be submitted if the strings match. Please ensure that your browser supports and accepts cookies, or your comment cannot be verified correctly.
CAPTCHA

 
 

About

This blog is written by Hanno Böck. Unless noted otherwise, its content is licensed as CC0.

You can find my web page with links to my work as a journalist here.

I am also publishing a newsletter about climate change and decarbonization technologies.

The blog uses the free software Serendipity and is hosted at schokokeks.org.

Hanno on Mastodon | Contact / Imprint | Privacy / Datenschutz