Re: Composing signing and encryption

Mark Nottingham <mnot@mnot.net> Tue, 03 May 2016 06:45 UTC

Return-Path: <ietf-http-wg-request+bounce-httpbisa-archive-bis2juki=lists.ie@listhub.w3.org>
X-Original-To: ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com
Delivered-To: ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 8604D12D126 for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Mon, 2 May 2016 23:45:03 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -7.917
X-Spam-Level:
X-Spam-Status: No, score=-7.917 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.001, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-0.996, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=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 4NxK80NxZAjO for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Mon, 2 May 2016 23:45:01 -0700 (PDT)
Received: from frink.w3.org (frink.w3.org [128.30.52.56]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 68A4312B011 for <httpbisa-archive-bis2Juki@lists.ietf.org>; Mon, 2 May 2016 23:45:01 -0700 (PDT)
Received: from lists by frink.w3.org with local (Exim 4.80) (envelope-from <ietf-http-wg-request@listhub.w3.org>) id 1axU0F-0007yy-82 for ietf-http-wg-dist@listhub.w3.org; Tue, 03 May 2016 06:40:15 +0000
Resent-Date: Tue, 03 May 2016 06:40:15 +0000
Resent-Message-Id: <E1axU0F-0007yy-82@frink.w3.org>
Received: from lisa.w3.org ([128.30.52.41]) by frink.w3.org with esmtps (TLS1.2:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from <mnot@mnot.net>) id 1axU08-0007xL-5f for ietf-http-wg@listhub.w3.org; Tue, 03 May 2016 06:40:08 +0000
Received: from mxout-07.mxes.net ([216.86.168.182]) by lisa.w3.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from <mnot@mnot.net>) id 1axU06-0008TG-Ln for ietf-http-wg@w3.org; Tue, 03 May 2016 06:40:07 +0000
Received: from [192.168.1.101] (unknown [120.149.194.112]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.mxes.net (Postfix) with ESMTPSA id 17FD922E1F3; Tue, 3 May 2016 02:39:41 -0400 (EDT)
Content-Type: text/plain; charset="us-ascii"
Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\))
From: Mark Nottingham <mnot@mnot.net>
In-Reply-To: <CABkgnnXKTqpMkdmuOz_-cLXJ3g-1YvFs3k6FggQdP5bVtQso+g@mail.gmail.com>
Date: Tue, 03 May 2016 16:39:39 +1000
Cc: HTTP Working Group <ietf-http-wg@w3.org>, Eric Rescorla <ekr@rtfm.com>
Content-Transfer-Encoding: quoted-printable
Message-Id: <251D4424-3FBA-4441-8C9B-2B0BC53E3A7D@mnot.net>
References: <CABkgnnXKTqpMkdmuOz_-cLXJ3g-1YvFs3k6FggQdP5bVtQso+g@mail.gmail.com>
To: Martin Thomson <martin.thomson@gmail.com>
X-Mailer: Apple Mail (2.3124)
Received-SPF: pass client-ip=216.86.168.182; envelope-from=mnot@mnot.net; helo=mxout-07.mxes.net
X-W3C-Hub-Spam-Status: No, score=-8.2
X-W3C-Hub-Spam-Report: AWL=1.358, BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, W3C_AA=-1, W3C_DB=-1, W3C_IRA=-1, W3C_IRR=-3, W3C_WL=-1
X-W3C-Scan-Sig: lisa.w3.org 1axU06-0008TG-Ln b930efd06c60581dbd1c43caf55e5a2f
X-Original-To: ietf-http-wg@w3.org
Subject: Re: Composing signing and encryption
Archived-At: <http://www.w3.org/mid/251D4424-3FBA-4441-8C9B-2B0BC53E3A7D@mnot.net>
Resent-From: ietf-http-wg@w3.org
X-Mailing-List: <ietf-http-wg@w3.org> archive/latest/31583
X-Loop: ietf-http-wg@w3.org
Resent-Sender: ietf-http-wg-request@w3.org
Precedence: list
List-Id: <ietf-http-wg.w3.org>
List-Help: <http://www.w3.org/Mail/>
List-Post: <mailto:ietf-http-wg@w3.org>
List-Unsubscribe: <mailto:ietf-http-wg-request@w3.org?subject=unsubscribe>

Thanks, Martin.

It sounds like you think we can continue the encrypted and streaming integrity content codings as separate work items (assuming we adopt MICE or something like it, and provided that all signature functionality is removed), perhaps including some text about the possible dangers of using encryption in combination with signatures in Security Considerations of the former. 

Future use cases that required signatures and encryption could be invented as new content codings, or composed (carefully) with them.

Is that correct, and if so, what do others think? Specifically CC:ing EKR here, as he brought this up in B-A.

Cheers,



> On 29 Apr 2016, at 11:20 AM, Martin Thomson <martin.thomson@gmail.com> wrote:
> 
> I've been looking into the issue ekr raised during the last
> meeting with respect to the risks involved with combining signing
> and encryption.
> 
> (tl;dr I don't think we need signing and I will drop it.)
> 
> A lot of the material concentrates on a messaging case, where a
> message is signed by the sender and encrypted toward the
> recipient.  For that scenario, composition isn't safe.
> 
> The property that is expected, namely that a message is sent from
> a particular sender to a particular recipient, is not provided by
> a simple composition of signing and encryption.  What is provided
> is *separate* statements of origin and destination.  An attacker
> can exploit this separation by replacing the outer layer with
> their own.  Depending on which is applied first, that allows the
> attacker to switch out their own origin or destination.
> 
> For messaging, a range of simple fixes are available, including
> the simple remedy of adding addressing information to the
> plaintext of the message and checking that it is correct.  Other
> techniques bind the signature to the encryption or vice versa.
> Personally, given what I know of other attempts to combine
> cryptographic primitives, I've concluded that a unified primitive
> that combines signing and encryption safely is a better way to
> solve the messaging problem.  Such a primitive could be properly
> and thoroughly analyzed by cryptographers.
> 
> But that's messaging.
> 
> The use cases currently identified for encryption and signing in
> HTTP don't have the same profile.  For the most part HTTPS is
> sufficient to address all of our direct 1-to-1 messaging
> scenarios.  Also critical here, I really don't want to create
> the impression that work on encryption is intended as a
> replacement for HTTPS.
> 
> However, based on my analysis, it appears as though the need for
> signing is not acute.  I am going to propose that we defer
> working on signing and will remove the (frankly) superficial
> treatment in the next revision of my -mice draft.
> 
> We could attempt to address the composition issue with some very
> careful security considerations.  I even drafted some up last
> week.  On balance, I would rather avoid any risk that we create
> tools that will be very hard to use safely.
> 
> --
> 
> Here is my more detailed analysis the use cases that I know
> about, for both signing and encryption:
> 
> ## Webpush
> 
> This is actually the scenario most alike messaging.  An
> application server places a message that is encrypted to a
> particular user agent on a push service.  The user agent later
> retrieves that message and decrypts it.  However, this use case
> does not use signing, just encryption, and a shared symmetric key
> is used with encryption to authenticate the origin of the
> message.
> 
> ## SRI
> 
> For sub-resource integrity, integrity is the only goal.  That
> might use signing, but composition with encryption isn't
> relevant.
> 
> ## File sharing
> 
> In this case, a file is encrypted and uploaded to a server before
> being shared.  Only clients with the URL and key can retrieve and
> decrypt the file.  In a sense, this file is encrypted toward
> multiple recipients.  It's conceivable here that the file could
> be signed as well as encrypted.
> 
> This is one case that would require great care before including
> signatures.  If the intent is to emulate a message from one
> entity to a specific set of recipients, then this could turn into
> the messaging problem.
> 
> ## Blind caching
> 
> Here we have an case that could use both signing and encryption,
> but in the course of doing this analysis, I discovered problems
> with these that are independent of the composition problems.
> Magnus Westerlund already identified an issue that is most
> problematic if we use signing.  Both problems are eliminated[*]
> if simple hash-based integrity plus encryption are used.
> 
> It's possible that for operational reasons, we will want to
> explore signing later.  And it's possible that it could be
> structured in a safe fashion.  There is no inherent assumptions
> around the relationship between encryption and message
> recipients, which might make using signatures for the purpose of
> integrity feasible if we determine that to be necessary.
> However, much more analysis would be needed to ensure that what
> we build is safe.  And we might want to build a far narrower
> solution if we take that option.
> 

--
Mark Nottingham   https://www.mnot.net/