Re: [jose] Richard Barnes' Discuss on draft-ietf-jose-json-web-signature-33: (with DISCUSS and COMMENT)

Mike Jones <Michael.Jones@microsoft.com> Tue, 14 October 2014 12:47 UTC

Return-Path: <Michael.Jones@microsoft.com>
X-Original-To: jose@ietfa.amsl.com
Delivered-To: jose@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 2FA8F1A87A1; Tue, 14 Oct 2014 05:47:55 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.902
X-Spam-Level:
X-Spam-Status: No, score=-1.902 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_PASS=-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 884L1VxLclx6; Tue, 14 Oct 2014 05:47:50 -0700 (PDT)
Received: from na01-bl2-obe.outbound.protection.outlook.com (mail-bl2on0114.outbound.protection.outlook.com [65.55.169.114]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 5606D1A87A0; Tue, 14 Oct 2014 05:47:50 -0700 (PDT)
Received: from BN3PR0301CA0034.namprd03.prod.outlook.com (25.160.180.172) by CY1PR0301MB1209.namprd03.prod.outlook.com (25.161.212.143) with Microsoft SMTP Server (TLS) id 15.0.1049.19; Tue, 14 Oct 2014 12:47:48 +0000
Received: from BY2FFO11FD051.protection.gbl (2a01:111:f400:7c0c::103) by BN3PR0301CA0034.outlook.office365.com (2a01:111:e400:4000::44) with Microsoft SMTP Server (TLS) id 15.0.1054.13 via Frontend Transport; Tue, 14 Oct 2014 12:47:47 +0000
Received: from mail.microsoft.com (131.107.125.37) by BY2FFO11FD051.mail.protection.outlook.com (10.1.15.188) with Microsoft SMTP Server (TLS) id 15.0.1039.16 via Frontend Transport; Tue, 14 Oct 2014 12:47:47 +0000
Received: from TK5EX14MBXC286.redmond.corp.microsoft.com ([169.254.1.93]) by TK5EX14HUBC103.redmond.corp.microsoft.com ([157.54.86.9]) with mapi id 14.03.0210.003; Tue, 14 Oct 2014 12:47:03 +0000
From: Mike Jones <Michael.Jones@microsoft.com>
To: Richard Barnes <rlb@ipv.sx>
Thread-Topic: [jose] Richard Barnes' Discuss on draft-ietf-jose-json-web-signature-33: (with DISCUSS and COMMENT)
Thread-Index: Ac/nrOuRDqkag9cnQbuqhrjolD201Q==
Date: Tue, 14 Oct 2014 12:47:02 +0000
Message-ID: <4E1F6AAD24975D4BA5B16804296739439BB0D32E@TK5EX14MBXC286.redmond.corp.microsoft.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-originating-ip: [157.54.51.36]
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-EOPAttributedMessage: 0
X-Forefront-Antispam-Report: CIP:131.107.125.37; CTRY:US; IPV:CAL; IPV:NLI; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(438002)(51704005)(199003)(13464003)(24454002)(189002)(377454003)(43784003)(52044002)(23676002)(64706001)(84676001)(44976005)(19580405001)(19580395003)(6806004)(66066001)(46102003)(2656002)(47776003)(69596002)(68736004)(50466002)(15975445006)(20776003)(85306004)(87936001)(33656002)(80022003)(85806002)(561944003)(26826002)(50986999)(15202345003)(85852003)(31966008)(54356999)(110136001)(81156004)(106466001)(76482002)(55846006)(95666004)(21056001)(92566001)(97736003)(230783001)(92726001)(86362001)(4396001)(120916001)(104016003)(86612001)(77096002)(99396003)(107046002); DIR:OUT; SFP:1102; SCL:1; SRVR:CY1PR0301MB1209; H:mail.microsoft.com; FPR:; MLV:ovrnspm; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en;
X-Microsoft-Antispam: UriScan:;
X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:;SRVR:CY1PR0301MB1209;
X-O365ENT-EOP-Header: Message processed by - O365_ENT: Allow from ranges (Engineering ONLY)
X-Forefront-PRVS: 03648EFF89
Received-SPF: Pass (protection.outlook.com: domain of microsoft.com designates 131.107.125.37 as permitted sender) receiver=protection.outlook.com; client-ip=131.107.125.37; helo=mail.microsoft.com;
Authentication-Results: spf=pass (sender IP is 131.107.125.37) smtp.mailfrom=Michael.Jones@microsoft.com;
X-OriginatorOrg: microsoft.onmicrosoft.com
Archived-At: http://mailarchive.ietf.org/arch/msg/jose/DBDhignFfQInqCIM5dk_vvqap7s
Cc: "jose-chairs@tools.ietf.org" <jose-chairs@tools.ietf.org>, The IESG <iesg@ietf.org>, "jose@ietf.org" <jose@ietf.org>, "draft-ietf-jose-json-web-signature@tools.ietf.org" <draft-ietf-jose-json-web-signature@tools.ietf.org>
Subject: Re: [jose] Richard Barnes' Discuss on draft-ietf-jose-json-web-signature-33: (with DISCUSS and COMMENT)
X-BeenThere: jose@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: Javascript Object Signing and Encryption <jose.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/jose>, <mailto:jose-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/jose/>
List-Post: <mailto:jose@ietf.org>
List-Help: <mailto:jose-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/jose>, <mailto:jose-request@ietf.org?subject=subscribe>
X-List-Received-Date: Tue, 14 Oct 2014 12:47:55 -0000

The resolutions proposed below have been applied to the -34 drafts.  I hope that you will choose to clear some or all of your DISCUSSes on that basis, however if you choose to leave some open for continued discussion by the working group, I understand that.  If so, please identify which ones you're choosing to have remain open, providing replies to my responses for those, if possible.

Note that an explicit reference to a JSON Serialization example was added to Section 3.3 as a result of your comment.

				Thanks again,
				-- Mike

> -----Original Message-----
> From: Mike Jones [mailto:Michael.Jones@microsoft.com]
> Sent: Saturday, October 11, 2014 2:15 PM
> To: Richard Barnes
> Cc: The IESG; jose-chairs@tools.ietf.org; jose@ietf.org; draft-ietf-jose-json-
> web-signature@tools.ietf.org
> Subject: RE: [jose] Richard Barnes' Discuss on draft-ietf-jose-json-web-
> signature-33: (with DISCUSS and COMMENT)
> 
> > From: Richard Barnes [mailto:rlb@ipv.sx]
> > Sent: Friday, October 10, 2014 3:20 PM
> > To: Mike Jones
> > Cc: The IESG; jose-chairs@tools.ietf.org; jose@ietf.org;
> > draft-ietf-jose-json-web-signature@tools.ietf.org
> > Subject: Re: [jose] Richard Barnes' Discuss on
> > draft-ietf-jose-json-web-signature-33: (with DISCUSS and COMMENT)
> >
> > On Mon, Oct 6, 2014 at 3:54 AM, Mike Jones
> <Michael.Jones@microsoft.com> wrote:
> > Thanks for your review, Richard.  I'm repeating my previous responses from
> my Thursday reply, but this time using ">" quoting rather than colors, for better
> readability by people not using HTML-enabled mail readers...
> >
> > > -----Original Message-----
> > > From: jose [mailto:jose-bounces@ietf.org] On Behalf Of Richard
> > > Barnes
> > > Sent: Wednesday, October 01, 2014 9:22 PM
> > > To: The IESG
> > > Cc: jose-chairs@tools.ietf.org; jose@ietf.org;
> > > draft-ietf-jose-json-web- signature@tools.ietf.org
> > > Subject: [jose] Richard Barnes' Discuss on draft-ietf-jose-json-web-signature-
> 33:
> > > (with DISCUSS and COMMENT)
> > >
> > > Richard Barnes has entered the following ballot position for
> > > draft-ietf-jose-json-web-signature-33: Discuss
> > >
> > > When responding, please keep the subject line intact and reply to
> > > all email addresses included in the To and CC lines. (Feel free to
> > > cut this introductory paragraph, however.)
> > >
> > >
> > > Please refer to
> > > http://www.ietf.org/iesg/statement/discuss-criteria.html
> > > for more information about IESG DISCUSS and COMMENT positions.
> > >
> > >
> > > The document, along with other ballot positions, can be found here:
> > > http://datatracker.ietf.org/doc/draft-ietf-jose-json-web-signature/
> > >
> > >
> > >
> > > --------------------------------------------------------------------
> > > --
> > > DISCUSS:
> > > --------------------------------------------------------------------
> > > --
> > >
> > > Overall, this document is in much more solid shape than when it began.
> > > Thanks to the WG for a lot of hard work.  I only have two remaining
> > > concerns, which should hopefully be easy to address.
> > >
> > > Section 7.2.
> > > I've had several implementers trying to use JWS in the JSON
> > > serialization ask why it was necessary to include a "signatures"
> > > array in cases where there's only one signer.  It seems like this is
> > > going to be a major barrier to deployment and re- use, so I would propose
> including the following text:
> > >
> > > """
> > > In cases where the JWS has been signed by only a single signer, the
> "signatures"
> > > array will contain a single object.  In such cases, the elements of
> > > the single "signatures" object MAY be included at the top level of
> > > the JWS object.  A JSON- formatted JWS that contains a "signatures"
> > > field MUST NOT contain a "protected", "header", or "signature" field, and
> vice versa.
> > > """
> > >
> > > This may also require some other changes where "signatures" is
> > > relied on, e.g., in Section 9 of the JWE spec.
> > This was previously proposed (I believe during the Denver interim meeting) and
> rejected by the working group because it complicates both producers and
> parsers by introducing an unnecessary special case.  Currently, by design,
> whether there are single or multiple signatures, the same syntax is used.  Your
> proposal would use a different syntax in the single signature case than in the
> multiple signature case.  This is likely to result in implementation bugs and
> inconsistencies.
> >
> > This assertion of complexity is bogus.  Have you implemented this syntax, or
> can you point me to someone who has, and has had problems?  I have
> implemented it and I'm asking for the simpler syntax.  I've gotten the same
> request from others, for JWE.
> 
> I'm not saying that anything is insurmountable.  I'm saying that having two
> equivalent syntaxes in the JSON Serialization for the same thing is going to make
> it more likely that some implementations won't correctly support both of them.
> For those following along, those two syntaxes would be:
> 
>   {
>    "payload":"<payload contents>",
>    "signatures":[
>     {"protected":"<integrity-protected header 1 contents>",
>      "header":<non-integrity-protected header 1 contents>,
>      "signature":"<signature 1 contents>"}]
>   }
> 
> and
> 
>   {
>    "payload":"<payload contents>",
>    "protected":"<integrity-protected header 1 contents>",
>    "header":<non-integrity-protected header 1 contents>,
>    "signature":"<signature 1 contents>"
>   }
> 
> Is your motivating use case a profile of the JSON Serialization in which multiple
> signatures aren't used or supported, and so for which the array notation would
> always be superfluous syntax?  Are you concerned that if this profile becomes
> the predominant use case, that some/many implementations wouldn't
> implement the more general multi-signature syntax (or would implement it
> incorrectly, since it would normally not ever be used or tested)?
> 
> I'd love to hear others in the working group chime in on this topic...
> 
> > > Section 6.
> > > """
> > > These Header Parameters MUST be integrity protected if the
> > > information that they convey is to be utilized in a trust decision.
> > > """
> > > This smells really fishy to me.  What's your attack scenario?  I'm
> > > pretty certain that there's no way any of these fields can be
> > > altered in such a way that (1) the signature will validate, and (2)
> > > the recipient will accept a key it shouldn't.  By way of contrast,
> > > CMS doesn't sign the certificate fields, and the Certificate payload
> > > in TLS is only signed as a side effect of the protocol's verification that the
> remote end has been the same through the whole handshake (which doesn't
> apply here).
> >
> > The attack scenario is trivial to describe.  If an attacker can change
> information used in a trust decision, the trust decision has no validity.  Unless
> the information is integrity-protected, the attacker could change the non-
> integrity-protected portions of the JWS in an undetectable way.
> >
> > That's hand waving, not an attack scenario.  Allow me to elaborate on this:
> >
> > There is no possible attack scenario for the key identifiers that identify a *key*
> (vs. a cert) -- jwk, jku, and kid.  For any given signed object, there is exactly one
> key that can validate the signature (otherwise the crypto is broken).  If the
> attacker changes the validation key, then the signature won't validate.  So there
> is no need to integrity protect these headers, since there's no point to the
> attacker changing them.  RFC 2634 actually has text to this effect:
> >
> > """
> >    The first version of this attack is a simple denial of service attack
> >    where an invalid certificate is substituted for the valid
> >    certificate. This renders the message unverifiable, as the public key
> >    in the certificate no longer matches the private key used to sign the
> >    message.
> > """
> 
> It's not clear to me that enabling the attacker to substitute keys and get the
> recipient to attempt to validate the signature with a key of the attacker's
> choosing doesn't constitute at least a portion of a viable attack scenario.  It may
> or may not (knowing for sure is beyond my specific cryptographic expertise in
> this area) and it may not now but may be in the future (when new attacks are
> created).  Requiring these parameters to be integrity protected when used in a
> trust decision does no harm and may do substantial good.
> 
> > With regard to the certificate identifiers ("x5u", "x5c", "x5t", and "x5t#S256"),
> the risks that Jim points out [RFC2634, Section 5] are real, but only apply in
> certain narrow circumstances.  Namely, the only time a risk arises is when two
> certificates have been issued for the same public key, with different attributes.
> This is exceedingly rare in practice, and all current secure messaging systems get
> along fine without protection against this attack.  And it might not even be an
> attack -- you could envision cases with "x5u" where the signer purposely
> presents different certificates to different relying parties!
> > So the blanket requirement that these fields MUST be integrity protected is not
> appropriate.  It is only required for certain special situations using certificates.
> Proposed revision:
> > Delete: "These Header Parameters MUST be integrity protected if the
> information that they convey is to be utilized in a trust decision."
> 
> Researching the history a bit more, this text was added to address issue #104
> http://trac.tools.ietf.org/wg/jose/trac/ticket/104 raised by Jim Schaad.  Unless
> Jim agrees that it is now somehow unnecessary, I don't believe that it's
> reasonable for us to now remove it.  Also, see Jim's related comments about
> trust statements and trust decisions in issue #74.
> 
> > Add new paragraph: "In situations where multiple certificates with different
> attributes may be issued over the same public key, there is a risk that one of
> these certificates may be substituted for another. In such situations, the creator
> of a JWS object MUST integrity protect the "x5u", "x5c", "x5t", and "x5t#S256"
> attributes, if present."
> >
> > For what it's worth, Sean had us add language in a number of places that
> basically said that information is only as trustworthy as its source and the means
> by which it is obtained.  If I remember correctly, this was one of those places.
> >
> > > --------------------------------------------------------------------
> > > --
> > > COMMENT:
> > > --------------------------------------------------------------------
> > > --
> > >
> > > Section 2.
> > > In the definition of "Unsecured JWS", it would be good to note that
> > > this requires "alg" == "none".
> >
> > OK
> >
> > > Section 3.3.
> > > Why doesn't this section have a JSON-encoded form as well?
> >
> > Because it's meant to be a simple introductory example to help people get
> their head around the concept - not a complete tutorial.  Other examples of
> JSON-encoded objects are found elsewhere in the document and lots of them
> are found in draft-ietf-jose-cookbook.
> >
> > > Appendix A.5.
> > > I would prefer if this example could be removed.  JWT is the only
> > > use case for Unsecured JWS right now, and there's already an example in
> that document.
> >
> > Mike> Given that it's important that implementers using them understand
> Unsecured JWSs, there is motivation to retain the example.  I'd be interested in
> what others in the working group think, given that there was substantial support
> for retaining this functionality when its removal was proposed.
> >
> > > Thanks for Appendix C.  FWIW, it has been implemented:
> > > http://dxr.mozilla.org/mozilla-central/source/dom/crypto/CryptoBuffe
> > > r.cpp#85
> >
> > You're welcome.
> >
> > > _______________________________________________
> > > jose mailing list
> > > jose@ietf.org
> > > https://www.ietf.org/mailman/listinfo/jose
> >
> >                                 Thanks again!
> >                                 -- Mike
> 
> 					-- Mike