<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd" [
<!ENTITY RFC2119 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml">
<!ENTITY RFC3279 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.3279.xml">
<!ENTITY RFC2560 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.2560.xml">
<!ENTITY RFC4732 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.4732.xml">
<!ENTITY RFC5019 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.5019.xml">
<!ENTITY RFC5912 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.5912.xml">
<!ENTITY RFC6960 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.6960.xml">
<!ENTITY RFC5280 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.5280.xml">
]>
<rfc submissionType="IETF" docName="draft-ietf-lamps-ocsp-nonce-00" category="std" ipr="trust200902">
	<!-- Generated by id2xml 1.5.0 on 2020-03-02T06:24:23Z -->
	<?rfc compact="yes"?>
	<?rfc text-list-symbols="*o+-"?>
	<?rfc subcompact="no"?>
	<?rfc sortrefs="no"?>
	<?rfc symrefs="yes"?>
	<?rfc strict="yes"?>
	<?rfc toc="yes"?>
	<front>
	<title>OCSP Nonce Extension</title>
	    <author initials="M." surname="Sahni" fullname="Mohit Sahni" role="editor">
      <organization>Palo Alto Networks</organization>
      <address>
	<postal>
	<street>3000 Tannery Way</street>
	<city>Santa Clara</city>
	<region>CA</region>
	<code>95054</code>
	<country>US</country>
	</postal>
        <email>msahni@paloaltonetworks.com</email>
      </address>
    </author>

	<date day="23" month="April" year="2020"/>
	<workgroup>LAMPS</workgroup>
	<abstract><t>
   This document specifies the updated format of the Nonce extension in
   Online Certificate Status Protocol (OCSP) request and response
   messages. OCSP is used to check the status of a certificate and the
   Nonce extension is used in the OCSP request and response messages to
   avoid replay attacks. This document updates the RFC 6960</t>

	</abstract>
	</front>

	<middle>
	<section title="Introduction" anchor="sect-1"><t>
   This document updates the usage and format of the Nonce extension
   used in OCSP request and response messages. This extension was
   previously defined in section 4.1.1 of <xref target="RFC6960"/>. The <xref target="RFC6960"/>
   does not mention any minimum and maximum length of the nonce
   extension. Due to not having an upper or lower limit of the length of
   the Nonce extension, the OCSP responders that follow <xref target="RFC6960"/> may be
	   vulnerable to various attacks like Denial of Service attacks <xref target="RFC4732"/>, chosen
   prefix attacks to get a desired signature from the OCSP responder and
   possible evasions that can use the Nonce extension data for evasion. This
   document specifies a lower limit of 1 and an upper limit of 32 to the
   length of the Nonce extension. This document updates the <xref target="RFC6960"/>.</t>

	<section title="Terminology" anchor="sect-1.1"><t>
   The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
   "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this
   document are to be interpreted as described in BCP 14 <xref target="RFC2119" format="default"/> <xref target="RFC8174" format="default"/> when, and only when, they appear in all capitals, as shown here.</t>

	</section>

	</section>

	<section title="OCSP Extensions" anchor="sect-2"><t>
   The message format for the OCSP request and response is defined in
   the <xref target="RFC6960"/>. It also defines the standard extensions for OCSP
   messages based on the extension model employed in X.509 version 3
   certificates (see <xref target="RFC5280"/>). Following is the list of standard
   extensions that can be used in the OCSP messages by the OCSP
   responder and OCSP client.</t>
	<t><list style="symbols"><?rfc subcompact="yes"?>
	<t>Nonce</t>
	<t>CRL References</t>
	<t>Acceptable Response Types</t>
	<t>Archive Cutoff</t>
	<t>CRL Entry Extensions</t>
	<t>Service Locator</t>
	<t>Preferred Signature Algorithms</t>
	<t>Extended Response Definition</t>
	<?rfc subcompact="no"?>
	</list>
	</t>
	<t>
   This document only specifies the new format for Nonce extension and
   does not change the specification of any of the other standard
   extensions.</t>

	<section title="Nonce Extension" anchor="sect-2.1">
	<t>
			This section updates the <eref target="https://tools.ietf.org/html/rfc6960#section-4.4.1">Section 4.4.1</eref> of <xref target="RFC6960"/>
    which describes the OCSP Nonce extension. 
    </t><t>
   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. If Nonce extension is present 
   then the length of nonce MUST be at least 1 octet and can be up to 32 octets. </t> 
   <t> 
   A server MUST reject any OCSP request having a Nonce extension with length of more than 32 octets
   with the malformedRequest OCSPResponseStatus as described in section 4.2.1 of <xref target="RFC6960"/>
   </t>
   <t>The minimum nonce length of 1 octet is defined to provide the backward compatibility with clients following <xref target="RFC6960"/>. 
	   However the newer OCSP clients MUST use length of at least 16 octets for Nonce extension and the value 
	   of the nonce MUST be generated using a cryptographically strong pseudorandom number generator.  </t>

	<figure><artwork><![CDATA[
   id-pkix-ocsp           OBJECT IDENTIFIER ::= { id-ad-ocsp }

   id-pkix-ocsp-nonce     OBJECT IDENTIFIER ::= { id-pkix-ocsp 2 }

   Nonce ::= OCTET STRING(SIZE(1..32))
]]></artwork>
	</figure>
	</section>

	</section>

	<section title="Security Considerations" anchor="sect-3">
	<t>      The security considerations of OCSP, in general, are described in
      the <xref target="RFC6960"/>. The Nonce extension is used to avoid replay attacks
      during the interval in which the previous OCSP response for a
      certificate is not expired but the responder has a changed status for
      that certificate. Including client's Nonce value in the OCSP
      response makes sure that the response is the latest response from
      the server and not an old copy.
	</t>

	<section title="Replay Attack" anchor="sect-3-1">
	<t>
      The Nonce extension is used to avoid replay attacks. Since the
      OCSP responder may choose to not send the Nonce extension in the
      OCSP response even if the client has sent the Nonce extension in
		the request <xref target="RFC5019"/>, a man in the middle (MITM) entity can intercept the
      OCSP request and respond with an earlier response from the server
      without the Nonce extension. This can be mitigated by the server using
      a closer nextUpdate value in the OCSP response.</t>

	</section>
	<section title="Nonce Collision" anchor="sect-3-2">
		<t>
			If the value of the nonce used by a client is not random enough, then an attacker may prefetch responses with the predicted nonce and can replay them, thus defeating the purpose of using nonce. Therefore the client MUST use a nonce value that contains cryptographically strong randomness and is freshly generated.
			Also if the length of the nonce is very small e.g. 1 octet then an attacker can prefetch responses with all the possible values of the nonce and replay a matching nonce. A client SHOULD use 32 octets for the nonce length.
		</t>
	</section>
	</section>

	<section title="IANA Considerations" anchor="sect-4"><t><list hangIndent="3" style="hanging"><t>
      This document does not include any new media type registrations
      for OCSP.</t>

	</list>
	</t>

	</section>
	<section title="Changes to Appendix B. of RFC 6960" anchor="sect-5"> 
	<t>
	This section updates the ASN.1 definitions of the OCSP Nonce extension in the Appendix B.1 and Appendix B.2 of the <xref target="RFC6960"/> 
	The Appendix B.1 defines OCSP using ASN.1 - 1998 Syntax and Appendix B.2 defines OCSP using ASN.1 - 2008 Syntax
	</t>
	<section title="Changes to Appendix B.1. OCSP in ASN.1 - 1998 Syntax" anchor="sect-5-1"> 
	<t>OLD Syntax: </t>
	<t>The definition of OCSP Nonce Extension is not provided in the Appendix B.1 of <xref target="RFC6960"/> for the ASN.1 - 1998 Syntax.  </t>
	<t>NEW Syntax: </t>
<figure><artwork><![CDATA[
    Nonce ::= OCTET STRING(SIZE(1..32))
]]></artwork>
</figure>
        </section>
        <section title="Changes to Appendix B.2 OCSP in ASN.1 - 2008 Syntax" anchor="sect-5-2"> 
<t>OLD Syntax: </t>
    <figure><artwork><![CDATA[
    re-ocsp-nonce EXTENSION ::= { SYNTAX OCTET STRING IDENTIFIED
        BY id-pkix-ocsp-nonce }

]]></artwork>
</figure>
    <t>NEW Syntax: </t>
    <figure><artwork><![CDATA[
    re-ocsp-nonce EXTENSION ::= { SYNTAX OCTET STRING(SIZE(1..32)) 
        IDENTIFIED BY id-pkix-ocsp-nonce }
]]></artwork>
	</figure>
		</section>				
	</section>
	</middle>

	<back>
	<references title="Normative References">
	<reference anchor="RFC2119" target="http://www.rfc-editor.org/info/rfc2119"><front>
	<title>Key words for use in RFCs to Indicate Requirement Levels</title>
	<author fullname="S. Bradner" initials="S." surname="Bradner">
	</author>

	<date month="March" year="1997"/>
	</front>

	<seriesInfo name="BCP" value="14"/>
	<seriesInfo name="RFC" value="2119"/>
	<seriesInfo name="DOI" value="10.17487/RFC2119"/>
	</reference>
	<reference anchor="RFC8174" target="https://www.rfc-editor.org/info/rfc8174">
	<front>
            <title>Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words</title>
            <author initials="B." surname="Leiba" fullname="B. Leiba">
            </author>
            <date year="2017" month="May"/>
	</front>
            <seriesInfo name="DOI" value="10.17487/RFC8174"/>
            <seriesInfo name="RFC" value="8174"/>
            <seriesInfo name="BCP" value="14"/>
        </reference>

	&RFC5280;
	&RFC6960;
	</references>
	<references title="Informative References">
	&RFC4732;
	&RFC5019;
	</references>
	</back>

	</rfc>
	
