Re: [lamps] RFC6960: Issue with the OCSP Nonce extension

Russ Housley <housley@vigilsec.com> Mon, 09 December 2019 13:15 UTC

Return-Path: <housley@vigilsec.com>
X-Original-To: spasm@ietfa.amsl.com
Delivered-To: spasm@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id AEA2A1201EA for <spasm@ietfa.amsl.com>; Mon, 9 Dec 2019 05:15:40 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.898
X-Spam-Level:
X-Spam-Status: No, score=-1.898 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=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 Mo3-_PJxLgG7 for <spasm@ietfa.amsl.com>; Mon, 9 Dec 2019 05:15:39 -0800 (PST)
Received: from mail.smeinc.net (mail.smeinc.net [209.135.209.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id DF0001200C4 for <spasm@ietf.org>; Mon, 9 Dec 2019 05:15:38 -0800 (PST)
Received: from localhost (localhost [127.0.0.1]) by mail.smeinc.net (Postfix) with ESMTP id 59DC5300B23 for <spasm@ietf.org>; Mon, 9 Dec 2019 08:15:37 -0500 (EST)
X-Virus-Scanned: amavisd-new at mail.smeinc.net
Received: from mail.smeinc.net ([127.0.0.1]) by localhost (mail.smeinc.net [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id Yxo-IMBaj2T7 for <spasm@ietf.org>; Mon, 9 Dec 2019 08:15:35 -0500 (EST)
Received: from a860b60074bd.fios-router.home (pool-108-51-198-163.washdc.fios.verizon.net [108.51.198.163]) by mail.smeinc.net (Postfix) with ESMTPSA id 7B855300ABE; Mon, 9 Dec 2019 08:15:35 -0500 (EST)
Content-Type: text/plain; charset="us-ascii"
Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\))
From: Russ Housley <housley@vigilsec.com>
In-Reply-To: <ade1e0e0-1143-5281-a882-11b6e84ff1aa@primekey.com>
Date: Mon, 09 Dec 2019 08:15:36 -0500
Cc: spasm@ietf.org
Content-Transfer-Encoding: quoted-printable
Message-Id: <C08E35BE-77D6-4491-A2BC-023334FA81EA@vigilsec.com>
References: <CAEpwuw2T6MnC7NDpu9wA2Vzm5vSKaK-Qpp49c096doDub65SkA@mail.gmail.com> <A1B0F914-AB90-4133-AADF-B8145D41D59D@vigilsec.com> <CAEpwuw1LPkRRrUTOEdRr8-XLkEiCMtB2CeGFnf0wiuC53pCRdA@mail.gmail.com> <ade1e0e0-1143-5281-a882-11b6e84ff1aa@primekey.com>
To: Tomas Gustavsson <tomas.gustavsson@primekey.com>
X-Mailer: Apple Mail (2.3445.104.11)
Archived-At: <https://mailarchive.ietf.org/arch/msg/spasm/Nh9fD4smTXnF4mhNYmbcULfgBSA>
Subject: Re: [lamps] RFC6960: Issue with the OCSP Nonce extension
X-BeenThere: spasm@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: "This is a venue for discussion of doing Some Pkix And SMime \(spasm\) work." <spasm.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/spasm>, <mailto:spasm-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/spasm/>
List-Post: <mailto:spasm@ietf.org>
List-Help: <mailto:spasm-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/spasm>, <mailto:spasm-request@ietf.org?subject=subscribe>
X-List-Received-Date: Mon, 09 Dec 2019 13:15:41 -0000

I do not know of any situation where 32 bytes is not enough for a nonce.

Russ


> On Dec 9, 2019, at 2:56 AM, Tomas Gustavsson <tomas.gustavsson@primekey.com> wrote:
> 
> Hi,
> 
> There was a discussion about this a few years back in Mozilla dev security.
> https://groups.google.com/forum/#!topic/mozilla.dev.security.policy/x3TOIJL7MGw
> Back then the motivation was the risk of a chosen-prefix attack.
> 
> We ended up limiting Nonce to 32 bytes:
> https://jira.primekey.se/browse/ECA-4906
> 
> 32 bytes has caused no issues globally during these past three years. Of
> course, moving the limit to 256 bytes is a no-brainer.
> 
> Is there some common best practice limit (32 in our case) that could
> function as a basis for the new max value?
> 
> Cheers,
> Tomas
> 
> On 2019-12-07 22:54, Mohit Sahni wrote:
>> Thanks Russ, I will work on writing a draft. 
>> 
>> On Sat, Dec 7, 2019 at 12:47 PM Russ Housley <housley@vigilsec.com
>> <mailto:housley@vigilsec..com>> wrote:
>> 
>>    It seems like the easiest fix is to update the ASN.1 to be:
>> 
>>        Nonce ::= OCTET STRING (SIZE(1..256))
>> 
>>    Your paragraph seems like the introduction to the update document.
>> 
>>    Russ
>> 
>> 
>>> On Dec 7, 2019, at 3:30 PM, Mohit Sahni <mohit06jan@gmail.com
>>    <mailto:mohit06jan@gmail.com>> wrote:
>>> 
>>> Hi All,
>>> The section 4.1.1 of the RFC6960 describes the format and ID for
>>    the Nonce extension in the OCSP request and response. According to
>>    the RFC the nonce will have the identifier id-pkix-ocsp-nonce and
>>    the type of the Nonce is an OCTATE STRING.  The problem I see is
>>    that the RFC does not mention whether the nonce should be of fixed
>>    length or should have a maximum length. Due to this reason the
>>    current implementations that follow this standard can accept very
>>    large OCSP requests and are vulnerable to denial of service attacks
>>    and various evasion tricks using the nonce field as a tunnel. Since
>>    most of the OCSP requests don't use TLS as transport someone in the
>>    path can also modify the HTTP request to inject large nonce thus
>>    making the situation worse.
>>> 
>>> I would like to propose that the standard MUST define a maximum
>>    length for Nonce or the Nonce MUST be of a defined fixed length. I
>>    lean towards proposing the standard to have a maximum value of 256
>>    bytes and minimum value of 1 byte to make it backward compatible.
>>> 
>>> Do you guys think it makes sense and if I should propose a draft
>>    for making Nonce length with a maximum of 256 and minimum of 1.
>>> 
>>> Here is the text from section 4.1.1 of RFC6960:
>>> 
>>>     The nonce cryptographically binds a request and a response to
>>    prevent
>>>     replay attacks.  The nonce is included as one of the
>>>     requestExtensions in requests, while in responses it would be
>>>     included as one of the responseExtensions.  In both the request and
>>>     the response, the nonce will be identified by the object identifier
>>>     id-pkix-ocsp-nonce, while the extnValue is the value of the nonce.
>>> 
>>>       id-pkix-ocsp           OBJECT IDENTIFIER ::= { id-ad-ocsp }
>>>       id-pkix-ocsp-nonce     OBJECT IDENTIFIER ::= { id-pkix-ocsp 2 }
>>> 
>>>       Nonce ::= OCTET STRING
>>> 
>>> -Mohit
>>> _______________________________________________
>>> Spasm mailing list
>>> Spasm@ietf.org <mailto:Spasm@ietf.org>
>>> https://www.ietf.org/mailman/listinfo/spasm
>> 
>> 
>> _______________________________________________
>> Spasm mailing list
>> Spasm@ietf.org
>> https://www.ietf.org/mailman/listinfo/spasm
>> 
> 
> _______________________________________________
> Spasm mailing list
> Spasm@ietf.org
> https://www.ietf.org/mailman/listinfo/spasm