Re: [openpgp] Revocations of third-party certifications (TPK+"CRL") [was: draft-dkg-openpgp-abuse-resistant-keystore-04.txt]

Jon Callas <joncallas@icloud.com> Wed, 28 August 2019 07:29 UTC

Return-Path: <joncallas@icloud.com>
X-Original-To: openpgp@ietfa.amsl.com
Delivered-To: openpgp@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 922F31200A4 for <openpgp@ietfa.amsl.com>; Wed, 28 Aug 2019 00:29:09 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.698
X-Spam-Level:
X-Spam-Status: No, score=-2.698 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=icloud.com
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 67tRz0ZG5L4b for <openpgp@ietfa.amsl.com>; Wed, 28 Aug 2019 00:29:06 -0700 (PDT)
Received: from mr85p00im-zteg06012001.me.com (mr85p00im-zteg06012001.me.com [17.58.23.197]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 0D13E1200C4 for <openpgp@ietf.org>; Wed, 28 Aug 2019 00:29:06 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=icloud.com; s=1a1hai; t=1566977345; bh=EkP5RB+iAPYkNlv8Q88gsXZiHz1hEbPxSypN0wiGXcg=; h=Content-Type:Subject:From:Date:Message-Id:To; b=jEkxwoT30NrZnmfEyim62m5C3hewJPgG5yavZLP3Oe7OzULwbJTFT7Hcsx9vJi0nK KNM9fXCdawm4pxhr5OV8avUgB2lqPRKLvsNmZsu3KPD0n52JefoF2Xpx03zQEXby/1 4sOGml7A1jNNmnq9l8NoJYvtA9OAOGNmvKY3/K0CHohbK9KBx39BSa4nlKLKDnNQ9g vAN/Gbmy+gCQYTcvwMpvb/hUqKDq4XyAL/v9A7iPjPjRVzo9NlAqGu5gM0AzSHDS5+ QcjJznsH1GWEBOIuT5Wq8+ufxIyU61LaiJDpHsfuc5VnEmAaUHjRS1FBikXpKefsLE 3qhPp5Yq9PgqQ==
Received: from [192.168.7.69] (thing1.merrymeet.com [173.164.244.99]) by mr85p00im-zteg06012001.me.com (Postfix) with ESMTPSA id 46AC9A00D07; Wed, 28 Aug 2019 07:29:05 +0000 (UTC)
Content-Type: text/plain; charset="us-ascii"
Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\))
From: Jon Callas <joncallas@icloud.com>
In-Reply-To: <87zhju9qlb.fsf@fifthhorseman.net>
Date: Wed, 28 Aug 2019 00:29:04 -0700
Cc: Jon Callas <joncallas@icloud.com>, openpgp@ietf.org
Content-Transfer-Encoding: quoted-printable
Message-Id: <6057F53D-2251-4B92-997B-EF241C2F4EF3@icloud.com>
References: <156650274021.14785.10325255315266801149.idtracker@ietfa.amsl.com> <875zmodi1v.fsf@fifthhorseman.net> <8736hsdfm4.fsf@fifthhorseman.net> <CAF751FB-4AFD-4E64-AD8C-E04B3031F50D@icloud.com> <87zhju9qlb.fsf@fifthhorseman.net>
To: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
X-Mailer: Apple Mail (2.3445.104.11)
X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-08-28_02:, , signatures=0
X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1812120000 definitions=main-1908280078
Archived-At: <https://mailarchive.ietf.org/arch/msg/openpgp/va67hV-M0g6dUNszRNq3J8kvoyM>
Subject: Re: [openpgp] Revocations of third-party certifications (TPK+"CRL") [was: draft-dkg-openpgp-abuse-resistant-keystore-04.txt]
X-BeenThere: openpgp@ietf.org
X-Mailman-Version: 2.1.29
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: Wed, 28 Aug 2019 07:29:10 -0000


> On Aug 27, 2019, at 3:43 PM, Daniel Kahn Gillmor <dkg@fifthhorseman.net> wrote:
> 
> On Tue 2019-08-27 13:05:35 -0700, Jon Callas wrote:
>> Yeah. I just cringed and said, "Oh, dear me, you just invented CRLs
>> and we *know* those don't work.
> 
> haha, sigh -- the way that CRLs "don't work" is roughly the same way
> that HKP-style keyservers "don't work".  In particular, most users don't
> check CRLs, and they don't refresh keys from keyservers.
> 
> One of the reasons that they don't check CRLs is because the relevant
> time for the check is often a low-latency situation (e.g. TLS session
> establishment) and the implementation doesn't want to block.
> Additionally, the user might not want to leak metadata about their
> activity to the CRL operator.  Both of these reasons are also why
> OpenPGP signature verifiers have a hard time collecting revocation
> information about the signature-issuing certificates.

Yup, this is pretty much what we said about CRLs back in the mid-90s. It's possible this is required at some level, and if it is, let's just skip ahead to an analogue of OCSP stapling (which could be done by a key server) and Certificate Transparency, 'cause the whole ontogeny recapitulates phylogeny thing is predictable.

The underlying issue is that revocation doesn't work. The reason revocation doesn't work comes from the first law of data-driven programming, which is that a datum having been emitted cannot be recalled. A revocation is kinda an anti-cert that we send out on a mission to find the cert, and then they mutually evaporate into raw energy.

If we willing to accept that there will always be copies of the old, unrevoked cert hanging around and things will happen because of that, then we reduced it to a solvable subset.

I believe an example of a reasonable thing to do would be to have the key server put a certification on the certificate that includes a URI back to it, and appropriate metadata (timestamps, TTLs, whatever else) and then we had a protocol by which the user of the cert would look at the key server certification and if it's in an untenable state (like the time has expired, or whatever else you want) that the user gets a fresh copy of that cert -- then we have a first approximation of a distributed CRLish thing and a working protocol. I say distributed because the information isn't in a list, it's on the cert itself. 

Nonetheless, even here there are edge conditions where the answer when the inevitable thing goes wrong is, "Don't do that, you'll hurt yourself." 

> 
> In either case (X.509 or PGP), though, if we're willing to accept a
> delay (i.e., we don't support low-latency requirements), and we can do
> scheduled/backgrounded onion-routed updates to our certificate stores to
> obscure the metadata patterns, we can mitigate some of those concerns.
> 
> But an additional concern for OpenPGP certificates (which X.509 doesn't
> have) is that the common keyservers are vulnerable to flooding attacks,
> as outlined in the draft under discussion here.
> 
> So while this discussion isn't aiming to fix the low-latency or metadata
> leakage concerns, it is trying to address the abuse concerns.  Maybe we
> can focus on that?

Sure. The abuse problem has been around, as well, and I'm glad you're taking up the cause.

> 
>> I think that it's better to keep things more or less the way we've
>> done them.
> 
> The way we've done them in OpenPGP up to now is vulnerable to abuse, as
> we've seen.  I'm hoping we can concretely specify what we need to do to
> avoid leaving the door open to that abuse.

I said more or less, not exactly. Look, I agree it's a problem worth solving. I'm the one who calls all those key servers "The La Brea Tar Pits" and I don't mean it as a compliment.

> 
>> Alice's revocation attaches to her prior certification, and they
>> travel together. They could both be dropped, but not only one. (Even
>> though I can't really imagine the case of no certification, but only a
>> revocation, in completeness.)
> 
> The case of an omitted certification but included revocation seems
> sensible to me.  If the keystore knows that a given certification is
> revoked, it might very sensibly want to refrain from redistributing it.
> 
> At the same time, it knows that the certification is out there, some
> people might have a copy of it, and those people need to know that a
> revocation has been issued.

Yeah. An issue with OpenPGP certificates is that they are ultimately a list of statements, and those statements can be rewritten with impunity. Overall, I think it's far more of a feature than a bug, because an alternative would make it so no one would be able to do anything without the key owner's permission, and that would disrupt things like key signings.

> 
>> If Alice isn't a good citizen and makes an abusive revocation, the
>> server can and should drop it.
> 
> How would you define "abusive revocation" in this context?  Is it a
> universal view of "abuse", or might different people have different
> perspectives?

I define it the way it's defined. An abusive revocation is something we'll learn over time, and it's something that the key server decides. 

> 
> For example, if we define abuse as being simply "too large", then
> perhaps we can fix a byte limit on what a "redistributable" revocation
> looks lke.  And if Bob attests to Alice's certification, he is
> implicitly willing to accept her (as yet unseen) revocation as well.

Why not both? Why not all?

Right now, we're dealing with abuse in the form of "too large." In the paragraphs below, you have other things that could also be abuse worth solving. 

> 
> This gets thornier if we look at arbitrary data in the revocation.  For
> example, if Alice's certification revocation contains a Reason for
> Revocation subpacket with a text string that says "the King is an
> imbecile" (and Bob needs his certificate to be distributable in a place
> where it's illegal to insult the King) or it says "Joe Smith was born on
> 1957-03-25" (and Bob lives needs his certificate to be distributable
> somwhere it's illegal to distribute "personal information" without the
> person's consent), then that would make Bob's certificate difficult to
> redistribute where he needs it to be.  This is where i get uncomfortable
> about the idea that there is some universally-applicable view of what an
> "abusive" revocation is, and why i think that Bob's sovereignty over his
> own certificate makes it really important.

This is why I declined to define it. It doesn't matter what it is at this point and we *will* be faced with abuse that is so clever we didn't think of it ahead of time. Update the server and roll.

> 
> Perhaps we could say that the most narrowly-tailored third-party
> certification revocation signature is acceptable -- the only three
> subpackets allowed:
> 
> * Issuer Fingerprint
> * Signature Creation Time
> * Reason For Revocation -- only with a code, and string MUST be empty
> 
> And of course the abuse-resistant keystore would have to
> cryptographically verify the certification revocation signature.

That works. I don't think it has to be that narrow, but that would work.

> 
> But does that mean that *any* revocation is freely attachable to any
> certificate?  What if Bob doesn't ask for a distribution of Alice's
> certification in the first place?  Is Alice allowed to slap a revocation
> onto Bob's certificate?

Yes. Alice is revoking *her* certification of Bob's key. Bob owns Bob's key, but Alice owns her certification of Bob's key. Bob can freely discard the certification or the certification+revocation, but he should not be allowed to keep Alice's certification without its matching revocation.

Part of my prologue of revocation not working is that Bob can always go do key surgery. To some extent, anyone can do key surgery. Bob can go in with a hex editor and pull off Alice's revocation, but general tools shouldn't allow it. Moreover, a key server shouldn't allow it. If Bob uploads a new copy of his key without Alice's mention at all, that's fine. The key server MUST not allow the revocation to be vanished alone.

We have not seen the abuse problem of certificates being nonsensical, but that could really happen. I am sure that if you did something like take the first part of Bob's key, threw in one of Aice's user ids along with all its certifications, and some subways and other things from Charlie's key, that some implementation's going to barf in amusing ways -- or worse, just accept it.

> 
> This brings us to this case:
> 
>> If Bob wants to just drop Alice's certification along with her
>> revocation, that's fine too.
> 
> So let's say Mallory gets ahold of Bob's secret key, and Bob's
> certificate has a certification from Alice, which Mallory likes.  Alice
> learns that Bob's secret key has been compromised, and she wants to
> revoke her certification of Bob.  But Mallory (masquerading as Bob)
> indicates "actually, do not distribute Alice's certification".  Then
> Mallory can hide Alice's revocation.  I don't think that's an acceptable
> outcome.

Any problem that starts with "Mallory gets ahold of Bob's secret key" and then goes on, is kinda like discussing an operating system exploit that starts with, "okay, the attacker is in kernel mode." In general, the attacker can have much more fun than whatever's described. Yes, yes, if Malloy has Bob's secret key, Mallory can do anything.

However, this is part of why we have designated revokers. The whole problem if an adversary having a copy of the key has to be solved with something irrevocable pointing to a third party. (This is preparing for death, too, and sadly it has to be done in advance.) If you have a designated revoker listed on the key server, then that entity can revoke even if the key is compromised. There isn't a way to solve this if the only actor is that one key.

The biggest fly in the ointment, though is that not only can Mallory masquerade as Bob, but Mallory can also make a "new" key (add in new user ids, delete the old ones) that points somewhere else but has the same key as Bob's. Mallory has the private key and so can do *anything* not just masquerade.

> 
> Furthermore, it's possible that Bob has *never* attested to (requested
> redistribution of) Alice's certification, though Alice's certification
> is known to some other party, let's say "Carol".  How should Carol be
> confident that she will learn of Alice's revocation, if it is created
> and published?

See first paragraph. This is part of why I say revocation does not and cannot work. A subset can.

Perhaps a key server ought to be a designated revoker itself in some but not all cases. Perhaps even the default one. Of course, I'm handwaving away things like accounts on that server, authentication, takeover policies, and lots of other things that will be fun for someone else.

The PGP key server used expiry time for this rather than a special signature. It just went and resigned things regularly.

> 
> Something like a CRL seems to still be required.

Or a signature on the key that's made by the key server itself that has a timeout and a lot of policy coded in it.

	Jon