Re: [websec] #58: Should we pin only SPKI, or also names

Trevor Perrin <trevp@trevp.net> Thu, 15 August 2013 09:09 UTC

Return-Path: <trevp@trevp.net>
X-Original-To: websec@ietfa.amsl.com
Delivered-To: websec@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 0359D11E8123 for <websec@ietfa.amsl.com>; Thu, 15 Aug 2013 02:09:20 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.852
X-Spam-Level:
X-Spam-Status: No, score=-2.852 tagged_above=-999 required=5 tests=[AWL=0.125, BAYES_00=-2.599, FM_FORGED_GMAIL=0.622, RCVD_IN_DNSWL_LOW=-1]
Received: from mail.ietf.org ([12.22.58.30]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 4tM57tdnxqeb for <websec@ietfa.amsl.com>; Thu, 15 Aug 2013 02:09:14 -0700 (PDT)
Received: from mail-wi0-f173.google.com (mail-wi0-f173.google.com [209.85.212.173]) by ietfa.amsl.com (Postfix) with ESMTP id 0C35B11E8127 for <websec@ietf.org>; Thu, 15 Aug 2013 02:09:07 -0700 (PDT)
Received: by mail-wi0-f173.google.com with SMTP id en1so2885908wid.12 for <websec@ietf.org>; Thu, 15 Aug 2013 02:09:00 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=R4cZFkFuSDk2gVyAAeVAN/bAjGM+es6Jrr5AMzwQviw=; b=nofBGhk8I7debjgg6JpFA4OBMgoaKvqvjNqeW4GaRVmcu71OuON0XegGMRuw2SzZAL UQC2wD0x/aEfluM3dFnEhuIGPIGqWvavhZ1Cu5R8YASdrkUXVJYiCGbuoLK1jSVe0ANV yuxxo8gXST+XZk2zgUTV1sYBPIbPzz1R56tcdjIFs4cxnaJNwFc763p4bxlWVOJPMRii 7JwOoV2QQWG6nZG1wmSMnX1o4COJGUNrRI3rg9QfaUmOSSprsxRUjCYwDByKwpAagFfb oLMjLnLD+iKvcKjbDOgkBV29bDi/wyefa56spva32FN/gYJ2hfysF9LReoe3OdbmmYgL 8c1w==
X-Gm-Message-State: ALoCoQmKdmsWlXkccTHBpsF80SjcIK6+h2FzfWUztFogF7Y2Rs4b8NSTjb8mIhhoG/QzNCYtl0e/
MIME-Version: 1.0
X-Received: by 10.180.97.226 with SMTP id ed2mr1236360wib.17.1376557740140; Thu, 15 Aug 2013 02:09:00 -0700 (PDT)
Received: by 10.216.212.9 with HTTP; Thu, 15 Aug 2013 02:08:59 -0700 (PDT)
X-Originating-IP: [166.137.187.36]
In-Reply-To: <520C91B3.20402@mozilla.org>
References: <060.be9b0009dc0350ca543f553042673944@trac.tools.ietf.org> <CAMm+LwjdGJC4FHCJ_OAYGRqCGGc0Nz1pLV=yVGK9M9E7drfujQ@mail.gmail.com> <CAOuvq200e9HnPX1w9sZ+e7ipBmdgZdPL5xzKDgcaDpSxz1N=gg@mail.gmail.com> <CAMm+Lwh384YBMXw-BDoxJw+AN4qv8x6GQpF9YK4PW1gQRnadpg@mail.gmail.com> <6125A841-6C85-4858-B37F-C021067F0CFA@checkpoint.com> <2035FF99-A079-4F2F-B4DE-962FE1C1B964@checkpoint.com> <CAOuvq20O9bqHGR-5eKPmasNnWEuNW7ACL7PxM09yoTmmyt1UUg@mail.gmail.com> <CAGZ8ZG2C4uB=4vgH325TWeNW89ne4E_DN0j9ZV0t2AKa1o+x9g@mail.gmail.com> <52089A35.9040103@mozilla.org> <CAGZ8ZG3HUUsQJ63mCqHd_LOq+KSdsVpG7Gibdif5dS4oGLywpA@mail.gmail.com> <52091598.7000306@mozilla.org> <faac23b0797219a618f8ffee1932f7e2.squirrel@webmail.dreamhost.com> <CAGZ8ZG1zRJ3fWsK7+Zd_CWjZKTms_YjAxFWzQ+=yrn_VTW+s4g@mail.gmail.com> <5209FF9D.1080208@mozilla.org> <CAGZ8ZG3-WgKuRCWSsB8U_Y72J9TYU83tsmY-QZ8=-8bOoxkj+A@mail.gmail.com> <520C166E.7000202@mozilla.org> <CAGZ8ZG0SHHFWkx-uQGAzCXXBijZw_PnsChfQ0zbmx5AWg6T2Vg@mail.gmail.com> <520C91B3.20402@mozilla.org>
Date: Thu, 15 Aug 2013 02:08:59 -0700
Message-ID: <CAGZ8ZG37s3RoL+TO33JBwuniQXJtV=cGvNrzARGUp9A9w3rn8g@mail.gmail.com>
From: Trevor Perrin <trevp@trevp.net>
To: Gervase Markham <gerv@mozilla.org>
Content-Type: text/plain; charset="ISO-8859-1"
Cc: websec <websec@ietf.org>
Subject: Re: [websec] #58: Should we pin only SPKI, or also names
X-BeenThere: websec@ietf.org
X-Mailman-Version: 2.1.12
Precedence: list
List-Id: Web Application Security Minus Authentication and Transport <websec.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/websec>, <mailto:websec-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/websec>
List-Post: <mailto:websec@ietf.org>
List-Help: <mailto:websec-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/websec>, <mailto:websec-request@ietf.org?subject=subscribe>
X-List-Received-Date: Thu, 15 Aug 2013 09:09:20 -0000

On Thu, Aug 15, 2013 at 1:30 AM, Gervase Markham <gerv@mozilla.org> wrote:
> On 15/08/13 09:20, Trevor Perrin wrote:
>> So you're expecting sites to edit their HPKP header on every cert
>> change?
>
> No; it's quite possible that the advice on renew would be "keep the same
> pins".

OK.  So you're expecting sites to request a new cert at least T days
prior to their existing cert expiring (where T is the length of time
needed for extant pins to expire).

The CA will inform them whether any new keys need to be added or
removed to the HPKP header, based on knowledge of their previous
header.

If new keys need to be added, the site will then go through an update
process like I described before:
 * Add the new keys to the HPKP header
 * Wait for time T (where T is sufficient for all older pins to expire)
 * Switch to new certificate
 * Once the switch is complete, delete any old keys from the HPKP header

Is this right?


> And I'd expect the CA to talk about the trade-offs with the customer
> before offering their best advice for the customer's situation.
>
>>  * Add their next end-entity key to the HPKP header
>>  * Wait for time T (where T is sufficient for all older pins to expire)
>>  * Switch to certificates with the new key
>>  * Once the switch is complete, delete the old key from the HPKP header
>>
>> Sound right?
>
> Pinning to an end-entity key is indeed more work.

Pinning to an end-entity key requires an update process on every key change.

Pinning to root keys requires an update process less frequently.  But
the process is of similar complexity.


> I suspect that for
> most sites, the best trade-off will be pinning to two or three roots,
> one from each of two or three different CAs, where the CA has told them
> "yes, we issue certs from this root for sites like you, and will
> continue to do so for the forseeable future".

I suspect most sites would prefer to pin more CAs, for safety's sake.
But I could be wrong.

It would be be nice if each CA is able to indicate a single key for
the customer.  But I'm not sure if that's feasible or excessively
risky.


>>> No matter what happens to the CA's business, as
>>> long as the root and intermediate you are using are still valid (and,
>>> absent a CA breach, they will be - no CA sells certs which use roots and
>>> intermediates which expire before the cert finishes its lifetime), you
>>> don't have to worry. When you get a new cert (renewal), you'll get
>>> updated pinning advice.
>>
>> In a strict sense I don't think this is true.  You're assuming every
>> end-entity cert "uses" a single root, which is constant for the
>> lifetime of the cert absent a CA breach.
>>
>> But HPKP pins are checked against the browser-constructed cert path,
>> which might contain intermediates and roots different from what the
>> website sent, or thinks its "using".
>
> That is true; however, a CA should be aware of the possible different
> constructible paths, and provide pinning advice which takes them into
> account.

Sure.  But how paths for a *single* cert are constructed can change
over time, independent of new cert issuance, which you're not
accounting for.


>> Example:  You pin what you think is the root cert of your current
>> certificate.  3 months later the intermediate is upgraded to a root in
>> the browser's trust store, or becomes cross-certified by a different
>> root.  Your pin fails, as the browser no longer constructs paths that
>> use the pinned root.
>
> In this scenario, you seem to have failed to consult your CA for advice
> on how best to pin to their chain :-)

No, they gave you correct advice at the time of issuance.  The root
key pin was sufficient.

But things changed (due to, say, merger or business relationship
change between CAs).


Trevor