Re: [websec] New draft of HTTP header-based public key pinning

Julian Reschke <julian.reschke@gmx.de> Wed, 09 November 2011 21:45 UTC

Return-Path: <julian.reschke@gmx.de>
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 18F4711E80AF for <websec@ietfa.amsl.com>; Wed, 9 Nov 2011 13:45:14 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -104.398
X-Spam-Level:
X-Spam-Status: No, score=-104.398 tagged_above=-999 required=5 tests=[AWL=-1.799, BAYES_00=-2.599, USER_IN_WHITELIST=-100]
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 qWEaPNwycb8o for <websec@ietfa.amsl.com>; Wed, 9 Nov 2011 13:45:13 -0800 (PST)
Received: from mailout-de.gmx.net (mailout-de.gmx.net [213.165.64.23]) by ietfa.amsl.com (Postfix) with SMTP id 1F30711E8093 for <websec@ietf.org>; Wed, 9 Nov 2011 13:45:12 -0800 (PST)
Received: (qmail invoked by alias); 09 Nov 2011 21:45:09 -0000
Received: from p5DCC32E8.dip.t-dialin.net (EHLO [192.168.178.36]) [93.204.50.232] by mail.gmx.net (mp013) with SMTP; 09 Nov 2011 22:45:09 +0100
X-Authenticated: #1915285
X-Provags-ID: V01U2FsdGVkX1/+5f1ySB/+cbCowteapaaL1U6FgWpksT1+wPBHRA rgKO/OSgd47clI
Message-ID: <4EBAF460.50009@gmx.de>
Date: Wed, 09 Nov 2011 22:45:04 +0100
From: Julian Reschke <julian.reschke@gmx.de>
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:8.0) Gecko/20111105 Thunderbird/8.0
MIME-Version: 1.0
To: Chris Palmer <palmer@google.com>
References: <CAOuvq21Ne0CWT3Dzn0sutGDBg0K+efZhxmqBZiLuxbO2OwxnFg@mail.gmail.com> <CA+cU71kFFpuooyiBTarvLT3VJigZhW0BgpQi1gMTn7zB=sFh+w@mail.gmail.com> <4EBA3B24.5060602@gmx.de> <CAOuvq20NEUAwPzStBa-kRVh4rUCFU6Ece1gN-kEb0FeFsweHGw@mail.gmail.com> <4EBAE198.3020406@gmx.de> <CAOuvq20GYnrbwMQE9KZkNTFqETxJ4utKKzFNZ3ThQLnKbL299Q@mail.gmail.com>
In-Reply-To: <CAOuvq20GYnrbwMQE9KZkNTFqETxJ4utKKzFNZ3ThQLnKbL299Q@mail.gmail.com>
Content-Type: text/plain; charset="UTF-8"; format="flowed"
Content-Transfer-Encoding: 7bit
X-Y-GMX-Trusted: 0
Cc: IETF WebSec WG <websec@ietf.org>
Subject: Re: [websec] New draft of HTTP header-based public key pinning
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: Wed, 09 Nov 2011 21:45:14 -0000

On 2011-11-09 22:28, Chris Palmer wrote:
>> From what I can gather, there is a thing called "header field
> recombination", in which a proxy or something collapses two or more
> headers of the same type into one, and joins their values with a ",".
> Therefore, I should not list multiple pins separated with a "," in the
> PKP header. OK.
>
> (This is new to me. Are there MITMs that really do this? Why?)

I know of *libraries* that do this, and I wouldn't rule out 
intermediates using those.

> (FWIW, the only relevant hit in the first page of Google results for [
> header field recombination ] is
> http://svn.tools.ietf.org/wg/httpbis/trac/ticket/231.)
>
>>    Public-Key-Pins: max-age=31536000;
>>        pins-sha1=4n972HfV354KP560yw4uqe/baXc=;
>>        pins-sha256=LPJNul+wow4m6DsqxbninhsWHlwfp0JecwQzYpOLmCQ=
>
> OK. I suppose now we might as well get rid of the "pins-" too.

Unless you need an extension point for other parameters.

>> Finally, allow quoted-string notation,
>>
>>    Public-Key-Pins: max-age=31536000;
>>        pins-sha1="4n972HfV354KP560yw4uqe/baXc=";
>>        pins-sha256="LPJNul+wow4m6DsqxbninhsWHlwfp0JecwQzYpOLmCQ="
>>
>> so that characters not allowed (such as "/") in HTTP tokens work.
>
> But if "/" is not allowed in HTTP tokens, we have to require
> quoted-string notation, and not merely allow it. Right?

Indeed. But they are used in base64, unless you switch to 
<https://tools.ietf.org/html/rfc4648#section-5>.

> Could anyone propose exact ABNF grammar that is acceptable given the
> above constraints? Currently, I have it as:
> ...

I made a proposal; is there something specific you didn't like?

Best regards, Julian