[Bug 1016643] Re: add-apt-repository downloads gpg key in an insecure fashion

Michael Vogt michael.vogt at ubuntu.com
Thu Sep 20 07:11:01 UTC 2012


Looking into this a bit I think we have various options:
- switch to hpks by default in apt-key for the keyserver requests in apt-key and refuse to do hpk
- change gnupg to reject if a downloaded key is of a different keyid than the requested key [1]
- add code to apt-key to check/fixup the commandline in adv and download the keys to a tempkeyring and check that before further importing
- fix softwareproperties/ppa.py only and download there using python-hpk or a custom implementation

Feedback welcome.

[1] This would be my preferred fix, it would involve adding a new
"expected_keys" parameter to import_keys_stream() in g10/keyserver.c or
a new "validate_expected_keys()" call or something.

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to software-properties in Ubuntu.
https://bugs.launchpad.net/bugs/1016643

Title:
  add-apt-repository downloads gpg key in an insecure fashion

Status in GNU Privacy Guard:
  Fix Released
Status in “apt” package in Ubuntu:
  Triaged
Status in “gnupg” package in Ubuntu:
  Fix Released
Status in “gnupg2” package in Ubuntu:
  Fix Released
Status in “software-properties” package in Ubuntu:
  Invalid
Status in “apt” source package in Lucid:
  Confirmed
Status in “gnupg” source package in Lucid:
  Fix Released
Status in “gnupg2” source package in Lucid:
  Fix Released
Status in “software-properties” source package in Lucid:
  Invalid
Status in “apt” source package in Natty:
  Confirmed
Status in “gnupg” source package in Natty:
  Fix Released
Status in “gnupg2” source package in Natty:
  Fix Released
Status in “software-properties” source package in Natty:
  Invalid
Status in “apt” source package in Oneiric:
  Confirmed
Status in “gnupg” source package in Oneiric:
  Fix Released
Status in “gnupg2” source package in Oneiric:
  Fix Released
Status in “software-properties” source package in Oneiric:
  Invalid
Status in “apt” source package in Precise:
  Triaged
Status in “gnupg” source package in Precise:
  Fix Released
Status in “gnupg2” source package in Precise:
  Fix Released
Status in “software-properties” source package in Precise:
  Invalid
Status in “apt” source package in Quantal:
  Triaged
Status in “gnupg” source package in Quantal:
  Fix Released
Status in “gnupg2” source package in Quantal:
  Fix Released
Status in “software-properties” source package in Quantal:
  Invalid
Status in “apt” source package in Hardy:
  Confirmed
Status in “gnupg” source package in Hardy:
  Fix Released
Status in “gnupg2” source package in Hardy:
  Fix Released
Status in “software-properties” source package in Hardy:
  Invalid

Bug description:
  add-apt-repository can add PPAs and automatically import the PPA gpg
  key.

  Unfortunately, it uses apt-key, which in turn uses gpg to download the
  key from a keyserver.

  gpg downloads keys from keyservers using the short key id, which is
  trivial to collide.

  It is therefore possible to either MITM the point where gpg downloads
  the key from the keyserver, or to simply upload a second colliding key
  to the keyserver. This can result in being able to MITM packages
  installed from PPAs.

To manage notifications about this bug go to:
https://bugs.launchpad.net/gnupg/+bug/1016643/+subscriptions




More information about the foundations-bugs mailing list