Re: [openpgp] Followup on fingerprints

Derek Atkins <derek@ihtfp.com> Fri, 31 July 2015 13:28 UTC

Return-Path: <derek@ihtfp.com>
X-Original-To: openpgp@ietfa.amsl.com
Delivered-To: openpgp@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id F10A71A87A8 for <openpgp@ietfa.amsl.com>; Fri, 31 Jul 2015 06:28:51 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.389
X-Spam-Level:
X-Spam-Status: No, score=-1.389 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HELO_MISMATCH_ORG=0.611] autolearn=no
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id PJSKZ6Z63k-P for <openpgp@ietfa.amsl.com>; Fri, 31 Jul 2015 06:28:50 -0700 (PDT)
Received: from mail2.ihtfp.org (MAIL2.IHTFP.ORG [204.107.200.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 4FDC51A87A4 for <openpgp@ietf.org>; Fri, 31 Jul 2015 06:28:50 -0700 (PDT)
Received: from localhost (localhost [127.0.0.1]) by mail2.ihtfp.org (Postfix) with ESMTP id C60F6E2035; Fri, 31 Jul 2015 09:28:48 -0400 (EDT)
Received: from mail2.ihtfp.org ([127.0.0.1]) by localhost (mail2.ihtfp.org [127.0.0.1]) (amavisd-maia, port 10024) with ESMTP id 12935-03; Fri, 31 Jul 2015 09:28:46 -0400 (EDT)
Received: from securerf.ihtfp.org (unknown [IPv6:fe80::ea2a:eaff:fe7d:235]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mocana.ihtfp.org", Issuer "IHTFP Consulting Certification Authority" (verified OK)) by mail2.ihtfp.org (Postfix) with ESMTPS id 8307FE2034; Fri, 31 Jul 2015 09:28:46 -0400 (EDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ihtfp.com; s=default; t=1438349326; bh=FXaGDh4jRTuvr1UZ63xIy+0jtRSmf9Fpvry0fDKXhMU=; h=From:To:Cc:Subject:References:Date:In-Reply-To; b=BRGVFuMCKhy7ik0fj3T0dOpwVy0ttbvXg7lW7pc/wqVE9lZZrShOVoH95GM6B7T7a /pA8cc7wnQQSCajkjFI++zymQesowT7q98ydGMbMInZImxt+Ei2TM2rfsom2x5lwi/ 2APBCYsYP0tDBH7IdJLFy4uqRBLcBzsyAxHr3bAo=
Received: (from warlord@localhost) by securerf.ihtfp.org (8.14.8/8.14.8/Submit) id t6VDSjK5026223; Fri, 31 Jul 2015 09:28:45 -0400
From: Derek Atkins <derek@ihtfp.com>
To: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
References: <CAMm+LwgTcn8CY+Zk-f9gzXQtMJezG97T+kx2=C7PR5g7zFer_A@mail.gmail.com> <87twsn2wcz.fsf@vigenere.g10code.de> <CAMm+LwgRJX-SvydmpUAJMmN3yysi4zzGSpO2yY4JAMhD-9xLgQ@mail.gmail.com> <87zj2ecmv8.fsf@alice.fifthhorseman.net> <CAMm+LwgKmcTes=V7uS3MjCQixWCo-i7PY=VE7eCHSqt3Ho3OSg@mail.gmail.com> <87a8udd4u6.fsf@alice.fifthhorseman.net>
Date: Fri, 31 Jul 2015 09:28:45 -0400
In-Reply-To: <87a8udd4u6.fsf@alice.fifthhorseman.net> (Daniel Kahn Gillmor's message of "Thu, 30 Jul 2015 11:48:17 -0400")
Message-ID: <sjm61503182.fsf@securerf.ihtfp.org>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Virus-Scanned: Maia Mailguard 1.0.2a
Archived-At: <http://mailarchive.ietf.org/arch/msg/openpgp/gvmIuPzbmk5fevcnz7AGaA5-dZI>
Cc: Phillip Hallam-Baker <phill@hallambaker.com>, IETF OpenPGP <openpgp@ietf.org>
Subject: Re: [openpgp] Followup on fingerprints
X-BeenThere: openpgp@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: "Ongoing discussion of OpenPGP issues." <openpgp.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/openpgp>, <mailto:openpgp-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/openpgp/>
List-Post: <mailto:openpgp@ietf.org>
List-Help: <mailto:openpgp-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/openpgp>, <mailto:openpgp-request@ietf.org?subject=subscribe>
X-List-Received-Date: Fri, 31 Jul 2015 13:28:52 -0000

Daniel Kahn Gillmor <dkg@fifthhorseman.net> writes:

> On Thu 2015-07-30 10:44:48 -0400, Phillip Hallam-Baker wrote:
>> That does not mean we have to support those applications. But it does
>> mean that we have to write a security consideration telling people we
>> have (1) considered the issue and that (2) either it isn't a problem
>> or you should do stuff that is going to be affected.
>
> Completely agreed that the security considerations should make a point
> of calling out what we think are legitimate and illegitimate uses of a
> fingerprint.
>
>> The concern here is that Mallet generates two keys that have the
>> fingerprints
>>
>> Mxxxx-xxxxx-xxxxx-xxxxx-xxxx1 'M1' and .
>> Mxxxx-xxxxx-xxxxx-xxxxx-xxxx2 'M2'
>>
>> Mallet joins an open source project which only takes the first 100 bits for
>> the fingerprint. He uploads the key for M1 to a keyserver.
>>
>> He then commits a large number of malicious patches using M2 for
>> authentication. These are all authenticated against his public key M2 when
>> he does the commit but the repository uses the key sent in band and does
>> not keep the key for later verification.
>>
>> At this point, any attempt to hold Mallet accountable is going to have to
>> rely on a human examining the logs and working out that Mallet must have
>> generated the malicious pair of keys. There is going to be no way to unwind
>> the thing automatically.

Why?  M1 and M2 are completely different fingerprints, unless you're
assuming that the x's are the same.  If the x's are the same that means
that Mallet has performed a 2^50 level attack to get 100 bits to match!
How long and how much energy does Mallet have to do this?  It's
certainly not something s/he is going to do over a long weekend!

> In either scenario, the committed code is done by Mallet, who was
> explicitly authorized by the system to commit code.  So the failure here
> is one of auditing, right?
>
> And i think the implementation recommendation that would solve the
> auditing problem here is "do not store fingerprints when you could be
> storing keys" -- right?
>
> Are there any other attacks we should be aware of due to failures of
> collision resistance in the fingerprint?

I'll note that this attack isn't due to a failure of collision
resistance in the fingerprint.  It's an attack due to the application
(on top of OpenPGP) truncating the fingerprint and throwing away extra
data.

Personally I don't see this as a bug in OpenPGP -- the data is there in
the OpenPGP data structures.  I see this as a bug in the application
built on top of OpenPGP that is throwing away data.

It's also an authorization issue; at some point someone needed to
authorize the M1 and M2 keys to commit, so someone *saw* the full
fingerprint at some point.  The fact that someone looked at the full
fingerprint and then threw away 60 bits just means they did a poor
design.

[snip]
>> Which you do probably depends on if you are using ECC or RSA. With RSA,
>> those 2048 bit keys start to bulk up...
>  [...]
>> It might sound a bit extreme, but since I started in the business, machines
>> have gotten roughly a million times faster and have a million times the
>> memory. 30 keypairs instead of one does not seem like a big deal.
>
> Following this logic, i think the answer is still that the endpoints
> should store the keys that they think are currently valid and not the
> fingerprints.  Fingerprints aren't for storage, they're either for
> discovery or for verification.

Or identification (e.g., the fingerprint/keyID of a signing key).  But
yes, the full key should be stored on the service when Mallet
registered.  There's yet another bug in the service (not OpenPGP) -- not
storing the keys of authorized users.

>           --dkg

-derek
-- 
       Derek Atkins                 617-623-3745
       derek@ihtfp.com             www.ihtfp.com
       Computer and Internet Security Consultant