Re: [websec] AD review of draft-ietf-websec-key-pinning-17

Yoav Nir <ynir.ietf@gmail.com> Thu, 26 June 2014 16:03 UTC

Return-Path: <ynir.ietf@gmail.com>
X-Original-To: websec@ietfa.amsl.com
Delivered-To: websec@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 832DB1B2C27 for <websec@ietfa.amsl.com>; Thu, 26 Jun 2014 09:03:07 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.999
X-Spam-Level:
X-Spam-Status: No, score=-1.999 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, HTML_MESSAGE=0.001, SPF_PASS=-0.001] autolearn=ham
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 uyeNQW6e1heH for <websec@ietfa.amsl.com>; Thu, 26 Jun 2014 09:03:04 -0700 (PDT)
Received: from mail-we0-x233.google.com (mail-we0-x233.google.com [IPv6:2a00:1450:400c:c03::233]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 4D9C51B2D5F for <websec@ietf.org>; Thu, 26 Jun 2014 08:07:01 -0700 (PDT)
Received: by mail-we0-f179.google.com with SMTP id w62so3846837wes.10 for <websec@ietf.org>; Thu, 26 Jun 2014 08:06:58 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :message-id:references:to; bh=9hnU942+GhBa8BwM6ohbvRoEYnemzfCFxv79Bhaaagk=; b=S4mMQCATyU9Y+4H3ButB/jCGaQ9cDVI2GAuB3/M6YOclFollRuu3wPJZZemTuuQT/K KLAEbZxrVAT+s9iQHvp0c1GcpC+PeHChBPrCKsgeEduY1gBml6nfvokWjpxCG1egseTB uOl6JWk/gssbcfUR1vlHvEt+v9S/15BqN9wo08gw+xC0t8c2owu5X+wPZGw1DYzFUM+i WUge99JHWBbqUcdKY9eKKVzD7594Mg9dZqM1LlOGUi2Fbqi//pdusLkjVjg9+Zxezjn+ TsmVXZlajrG4sMA2xgKngQotLIgTfQgBRA2CmKzuiJQFsX2oI3x+/nNTlx5xeOTt9FXN /yEg==
X-Received: by 10.194.71.132 with SMTP id v4mr18793006wju.102.1403795217173; Thu, 26 Jun 2014 08:06:57 -0700 (PDT)
Received: from [172.24.251.205] (dyn32-131.checkpoint.com. [194.29.32.131]) by mx.google.com with ESMTPSA id cz4sm66789706wib.23.2014.06.26.08.06.55 for <multiple recipients> (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 26 Jun 2014 08:06:56 -0700 (PDT)
Content-Type: multipart/alternative; boundary="Apple-Mail=_E3D88E97-94B2-4F7D-822F-8FEFCF27287F"
Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.2\))
From: Yoav Nir <ynir.ietf@gmail.com>
In-Reply-To: <CALaySJLWny1EBpre_v_A80XTX2n0tSs1s7tXdh7z_joTHGNU6w@mail.gmail.com>
Date: Thu, 26 Jun 2014 18:06:48 +0300
Message-Id: <BD085BE7-6903-4F7C-87AD-C21A179D26E6@gmail.com>
References: <CALaySJLWny1EBpre_v_A80XTX2n0tSs1s7tXdh7z_joTHGNU6w@mail.gmail.com>
To: Barry Leiba <barryleiba@computer.org>
X-Mailer: Apple Mail (2.1878.2)
Archived-At: http://mailarchive.ietf.org/arch/msg/websec/plrwLPUS7I0BujsyG76Ks7prF1c
Cc: draft-ietf-websec-key-pinning.all@tools.ietf.org, "websec@ietf.org" <websec@ietf.org>
Subject: Re: [websec] AD review of draft-ietf-websec-key-pinning-17
X-BeenThere: websec@ietf.org
X-Mailman-Version: 2.1.15
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, 26 Jun 2014 16:03:07 -0000

Thanks, Barry.

Authors: you seem to have your work cut out for you.   And to the rest of the working group: there is a good reason why Barry has sent this to the list. Dealing with the AD review is a task for the working group, not only the authors and chairs. So everyone, please feel free to jump in.

The below responses are my own and have no hats.  I’m skipping the language ones, because me not American, me no talk English good. 

On Jun 26, 2014, at 2:00 PM, Barry Leiba <barryleiba@computer.org> wrote:

> Is "we believe that" in the middle of the second paragraph something
> that should stand as it is in the final RFC?

                We believe that, with care, host operators can greatly
   reduce the risk of main-in-the-middle (MITM) attacks and other false-
   authentication problems for their users without incurring undue risk.

I think this should stay. 

> 
>   Additional directives extending the semantic functionality of the
>   header fields can be defined in other specifications, with a registry
>   (having an IANA policy definition of IETF Review [RFC5226]) defined
>   for them at such time.  Such future directives will be ignored by UAs
>   implementing only this specification, as well as by generally non-
>   conforming UAs.
> 
> I don't think it's clear enough that this document doesn't define that
> registry, and that this is giving instruction for future registry
> creation.  Please talk with me about why you feel the need *now* to
> say that a future registry will have to use IETF Review as its policy.
> Why would Specification Required or Expert Review not be OK?  Why
> shouldn't the decision be left for the time the registry is created?

I agree with that. How about:

NEW:
   Additional directives extending the semantic functionality of the
   header fields can be defined in other specifications. The first 
   such specification will need to define a registry for such 
   directives.

>   In the pin-directive, the token is the name of a cryptographic hash
>   algorithm, and MUST be "sha256".  (In the future, additional hash
>   algorithms MAY be registered and used.)  The quoted-string is a
>   sequence of base 64 digits: the base 64-encoded SPKI Fingerprint
>   ([RFC4648]).  See Section 2.4.
> 
> I don't like the MUST there (nor the MAY).  As to "registered and
> used", is this intended to be in the same registry as above?  So the
> directive "pin-sha256" would be registered, along with a new
> "pin-shaXYZ"?
> 
> Assuming that's right, I'm really starting to think that the registry
> should be created now.  The reason to defer creation is if we think
> that no new directives will ever really come along, so we won't need
> the registry.  But if the hash algorithm names will be in the
> registry, we can be pretty sure we'll need new ones.

This I will push back on. The day SHA-256 becomes not good enough for this purpose is when there is a second pre-image attack against SHA-256. We don’t have that yet even for MD5. I don’t think we’re going to *need* a pin-SHA512 or a pin-SHA3-256.  Somebody might *want* a pin-GOST-R34.11-94, but in that case I’m happy to leave the work of setting up a registry to them.

> Anyway, a fix for this paragraph (but this will change if we create
> the registry now) could be like this:
> 
> NEW
>   In the pin-directive, the token is the name of a cryptographic hash
>   algorithm.  The only algorithm allowed at this time is "sha256";
>   additional algorithms may be defined in the future. The quoted-string
>   is a sequence of base 64 digits: the base 64-encoded SPKI Fingerprint
>   [RFC4648].  See Section 2.4.
> END

I’m fine with this change.

>   The UA MUST ignore pin-directives with tokens naming hash algorithms
>   it does not recognize.  If the set of remaining effective pin-
>   directives is empty, and if the connection passed Pin Validation with
>   the UA's existing noted pins for the Host (i.e. the Host is a Known
>   Pinned Host), the UA MUST cease to consider the Host as a Known
>   Pinned Host.  (I.e. the UA should fail open.)  The UA SHOULD indicate
>   to users that the Host is no longer a Known Pinned Host.
> 
> The first sentence follows from (5) in the above list, so I suggest
> you say so.  This also appears to be where you define "Known Pinned
> Host", but you've buried the lede here.  I suggest this:
> 
> NEW
>   When a connection passes Pin Validation using the UA's noted pins
>   for the Host at the time, the Host becomes a Known Pinned Host.
> 
>   According to rule 5, above, the UA MUST ignore pin-directives with
>   tokens naming hash algorithms it does not recognize.  If the set of
>   remaining effective pin-directives is empty, and if the Host is a
>   Known Pinned Host, the UA MUST cease to consider the Host as a Known
>   Pinned Host (the UA should fail open).  The UA SHOULD indicate to
>   users that the Host is no longer a Known Pinned Host.
> END
> 
> On the last sentence, though, I'm really unsure: are we really giving
> UI advice in a protocol document?  Is that a good idea?  Do w have any
> sense that my mother will have the first idea what you're talking
> about when you indicate this to her?

We do often write sentences like “This event should be logged.” I don’t think either your mother or mine regularly run Console.app or eventvwr.exe to check logs. I guess this is the equivalent statement for user agents. It makes sense that if there is some indication that a website is pinned, that indication SHOULD be gone when the website is unpinned. It’s not for us to say how a particular vendor will indicate pinning in their UI, but I think it’s reasonable to say that the pinning indication should be gone.

> -- Section 4.3 --
> 
>   Because having a backup key pair is so important to recovery, UAs
>   MUST require that hosts set a Backup Pin. (See Section 2.5.)
> 
> Unless I misunderstand, this requirement means that if my server
> doesn't send a backup pin, my server doesn't benefit from key pinning
> (it's as though I never included the header in the first place).  If
> that's not true, then Section 2.5 needs to be fixed to make it clear
> that failure to include a backup pin constitutes a validation failure.
> 
> If that is true, then you're trading off recovery for security, and I
> expect the Security ADs to question that.  To head that off, it might
> be good to acknowledge that here, and perhaps to say a few more words
> about it.

How about:
The down side of keeping a not-yet-deployed key pair
is that if an attacker gains control of the private
key she will be able to perform a MitM attack without being
discovered. Care must be taken to avoid leaking the key, such
as keeping it offline.


Yoav