<?xml version="1.0" encoding="US-ASCII"?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd" [
]>
<?xml-stylesheet type="text/xsl" href="rfc2629.xslt" ?> <!-- used by XSLT processors -->
<!-- OPTIONS, known as processing instructions (PIs) go here. -->
<?rfc toc="yes" ?>
<?rfc symrefs="yes" ?>
<?rfc strict="no" ?>
<rfc category="bcp" docName="draft-gont-numeric-ids-sec-considerations-08" ipr="trust200902" updates="3552">

<front>
<title abbrev="Security Considerations for IDs">Security Considerations for Transient Numeric Identifiers Employed in Network Protocols</title>

    <author fullname="Fernando Gont" initials="F." surname="Gont">
      <organization abbrev="SI6 Networks">SI6 Networks</organization>

      <address>
        <postal>
	  <street>Segurola y Habana 4310 7mo piso</street>	
          <city>Ciudad Autonoma de Buenos Aires</city>
          <region>Buenos Aires</region>
          <country>Argentina</country>
        </postal>

<!--       <phone>+54 11 4650 8472</phone> -->
        <email>fgont@si6networks.com</email>
        <uri>https://www.si6networks.com</uri>

       </address>
    </author>

    
    <author fullname="Ivan Arce" initials="I." surname="Arce">
      <organization abbrev="Quarkslab">Quarkslab</organization>

      <address>
        <postal>
	  <street>Segurola y Habana 4310 7mo piso</street>	
          <city>Ciudad Autonoma de Buenos Aires</city>
          <region>Buenos Aires</region>
          <country>Argentina</country>
        </postal>

        <email>iarce@quarkslab.com</email>

        <uri>https://www.quarkslab.com</uri>

       </address>
    </author>


<date/>
<!--
<area>Internet</area>
<workgroup>Dynamic Host Configuration (dhc)</workgroup>
-->
<!-- <area/> -->
<!-- <workgroup/> -->

    <abstract>
    <t>
Poor selection of transient numerical identifiers in protocols such as the TCP/IP suite has historically led to a number of attacks on implementations, ranging from Denial of Service (DoS) to data injection and information leakage that can be exploited by pervasive monitoring.  To prevent such flaws in future protocols and implementations, this document updates RFC 3552, requiring future RFCs to contain a vulnerability assessment of their transient numeric identifiers.
    </t>
    </abstract>
</front>

  <middle>
  
<section title="Introduction" anchor="intro">
<t>
Network protocols employ a variety of transient numeric identifiers for different protocol entities, ranging from DNS Transaction IDs (TxIDs) to transport protocol numbers (e.g. TCP ports) or IPv6 Interface Identifiers (IIDs). These identifiers usually have specific properties that must be satisfied such that they do not result in negative interoperability implications (e.g., uniqueness during a specified period of time), and an associated failure severity when such properties not met.
</t>

<t>The TCP/IP protocol suite alone has been subject to variety of attacks on its transient numeric identifiers over the past 30 years or more, with effects ranging from Denial of Service (DoS) or data injection, to information leakage that could be exploited for pervasive monitoring <xref target="RFC7258"/>. The root of these issues has been, in many cases, the poor selection of identifiers in such protocols, usually as a result of insufficient or misleading specifications. While it is generally trivial to identify an algorithm that can satisfy the interoperability requirements for a given identifier, there exists practical evidence <xref target="I-D.irtf-pearg-numeric-ids-history"/> that doing so without negatively affecting the security and/or privacy properties of the aforementioned protocols is prone to error.</t>

<t>For example, implementations have been subject to security and/or privacy issues resulting from:

<list style="symbols">
<t>Predictable TCP sequence numbers (see e.g. <xref target="Morris1985"/>, <xref target="Bellovin1989"/>, and <xref target="RFC6528"/>)</t>
<t>Predictable transport protocol numbers (see e.g. <xref target="Silbersack2005"/> and <xref target="RFC6056"/>)</t>
<t>Predictable IPv4 or IPv6 Fragment Identifiers (see e.g. <xref target="Sanfilippo1998a"/>, <xref target="RFC6274"/>, and <xref target="RFC7739"/>)</t>
<t>Predictable IPv6 IIDs (see e.g. <xref target="RFC7217"/>, <xref target="RFC7707"/>, and <xref target="RFC7721"/>)</t> 
<t>Predictable DNS TxIDs (see e.g. <xref target="Schuba1993"/> and <xref target="Klein2007"/>)</t>
</list>


Recent history indicates that when new protocols are standardized or new protocol implementations are produced, the security and privacy properties of the associated identifiers tend to be overlooked and inappropriate algorithms to generate such identifiers are either suggested in the specification or selected by implementers. As a result, advice in this area is warranted.
</t>

<t>We note that the use of cryptographic techniques for confidentiality and authentication may readily mitigate some of the issues arising from predictable transient numeric identifiers. For example, cryptographic authentication can readily mitigate data injection attacks even in the presence of predictable transient numeric identifiers (such as "sequence numbers"). However, use of flawed algorithms (such as global counters) for generating transient numeric identifiers could still result in information leakages even when cryptographic techniques are employed. These information leakages could in turn be leveraged to perform other devastating attacks (please see <xref target="I-D.irtf-pearg-numeric-ids-generation"/> for further details).
</t>


<t><xref target="issues"/> provides an overview of common flaws in the specification of transient numeric identifiers. <xref target="vulns"/> provides an overview of the implications of predictable transient numeric identifiers. Finally, <xref target="reqs"/> provides key guidelines for protocol designers.
</t>

</section>


<section title="Terminology" anchor="terminology">
<t>
<list style="hanging">
<t hangText="Transient Numeric Identifier:">
<vspace blankLines="0" />A data object in a protocol specification that can be used to definitely distinguish a protocol object (a datagram, network interface, transport protocol endpoint, session, etc) from all other objects of the same type, in a given context. Transient numeric identifiers are usually defined as a series of bits, and represented using integer values. These identifiers are typically dynamically selected, as opposed to statically-assigned numeric identifiers (see e.g. <xref target="IANA-PROT"/>). We note that different identifiers may have additional requirements or properties depending on their specific use in a protocol. We use the term "transient numeric identifier" (or simply "numeric identifier" or "identifier" as short forms) as a generic term to refer to any data object in a protocol specification that satisfies the identification property stated above.
</t>

<t hangText="Failure Severity:">
<vspace blankLines="0" />The consequences of a failure to comply with the interoperability requirements of a given identifier. Severity considers the worst potential consequence of a failure, determined by the system damage and/or time lost to repair the failure. In this document we define two types of failure severity: "soft" and "hard".
</t>


<t hangText="Hard Failure:">
<vspace blankLines="0" />A hard failure is a non-recoverable condition in which a protocol does not operate in the prescribed manner or it operates with excessive degradation of service. For example, an established TCP connection that is aborted due to an error condition constitutes, from the point of view of the transport protocol, a hard failure, since it enters a state from which normal operation cannot be recovered.
</t>

<t hangText="Soft Failure:">
<vspace blankLines="0" />A soft failure is a recoverable condition in which a protocol does not operate in the prescribed manner but normal operation can be resumed automatically in a short period of time. For example, a simple packet-loss event that is subsequently recovered with a retransmission can be considered a soft failure.
</t>
</list>
</t>


<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' /> <xref target='RFC8174' /> when, and only when, they
      appear in all capitals, as shown here.
</t>
   
</section>



<section title="Issues with the Specification of Transient Numeric Identifiers" anchor="issues">
<t>A recent survey of transient numeric identifier usage in protocol specifications and implementations <xref target="I-D.irtf-pearg-numeric-ids-history"/> revealed that most of the issues discussed in this document arise as a result of one of the following conditions:

<list style="symbols">
<t>Protocol specifications that under-specify the requirements for their identifiers</t>
<t>Protocol specifications that over-specify their identifiers</t>
<t>Protocol implementations that simply fail to comply with the specified requirements</t>
</list>
</t>


   <t>Both under-specifying and over-specifying identifiers is
   hazardous. TCP port numbers and sequence numbers <xref target="RFC0793"/> and DNS TxID
   <xref target="RFC1035"/> were originally under-specified, leading to implementations that used
   predictable values and thus were vulnerable to numerous off-path
   attacks.  Over-specification, as for IPv6 Interface Identifiers (IIDs)
   <xref target="RFC4291"/> and Fragment Identification values <xref target="RFC2460"/>, left
   implementations unable to respond to security and privacy issues
   stemming from the mandated algorithms -- IPv6 IIDs need not expose
   privacy-sensitive link-layer addresses, and predictable Fragment
   Identifiers invite the same off-path attacks that plague TCP.</t>


<t>Finally, there are protocol implementations that simply fail to comply with existing protocol specifications. That is, appropriate guidance is provided by the protocol specification (whether the core specification or or an update to it), but an implementation simply fails to follow such guidance. For example, some popular operating systems (notably Microsoft Windows) still fail to implement transport-protocol port randomization, as specified in <xref target="RFC6056"/>.</t>

<t>Clear specification of the interoperability requirements for the transient numeric identifiers will help identify possible algorithms that could be employed to generate them, and also make evident if such identifiers are being over-specified. A protocol specification will usually also benefit from a vulnerability assessment of the transient numeric identifiers they specify, to prevent the corresponding considerations from being overlooked. 
</t>


</section>


<section title="Common Flaws in the Generation of Transient Numeric Identifiers" anchor="vulns">

<t>This section briefly notes common flaws associated with the generation of transient numeric identifiers. Such common flaws include, but are not limited to:
<list style="symbols">
<t>Employing trivial algorithms (e.g. global counters) that result in predictable identifiers</t>
<t>Employing the same identifier across contexts in which constancy is not required</t>
<t>Re-using identifiers across different protocols or layers of the protocol stack</t>
<t>Initializing counters or timers to constant values, when such initialization is not required</t>
<t>Employing the same increment space across different contexts</t>
<t>Use of flawed pseudo-random number generators (PRNGs).</t>
</list>
</t>

<t>
   Employing trivial algorithms for generating the identifiers means
   that any node that is able to sample such identifiers can easily
   predict future identifiers employed by the victim node.</t>

<t>
   When one identifier is employed across contexts where such constancy
   is not needed, activity correlation is made made possible.  For
   example, employing an identifier that is constant across networks
   allows for node tracking across networks.
</t>

<t>
   Re-using identifiers across different layers or protocols ties the
   security and privacy properties of the protocol re-using the identifier to the
   security and privacy properties of the original identifier (over
   which the protocol re-using the identifier may have no control
   regarding its generation).  Besides, when re-using an identifier
   across protocols from different layers, the goal of of isolating the
   properties of a layer from that of another layer is broken, and the
   vulnerability assessment may be harder to perform, since the
   combined system, rather than each protocol in isolation will have to
   be assessed.
</t>

<t>
   At times, a protocol needs to convey order information (whether
   sequence, timing, etc.).  In many cases, there is no reason for the
   corresponding counter or timer to be initialized to any specific
   value e.g. at system bootstrap. Similarly, there may not be a need for the difference between successive counted
values to be a predictable.
</t>


<t>
   A node that implements a per-context linear function may share the
   increment space among different contexts (please see the "Simple
   Hash-Based Algorithm" in <xref target="I-D.irtf-pearg-numeric-ids-generation"/>).
   Sharing the same increment space allows an attacker that can sample
   identifiers in other context to e.g. learn how many identifiers have
   been generated between two sampled values.
   </t>
   
<t>Finally, some implementations have been found to employ flawed PRNGs (see e.g. <xref target="Klein2007"/>).</t>
</section>



<section title="Vulnerability Assessment Requirements for Transient Numeric Identifiers" anchor="reqs">
<t>Protocol specifications that employ transient numeric identifiers SHOULD:
<list style="numbers">


<t>Clearly specify the interoperability requirements for the aforementioned transient numeric identifiers (e.g., required properties such as uniqueness, along with the failure severity if such properties are not met).</t>
<t>Provide a vulnerability assessment of the aforementioned identifiers.


<list style="hanging">
<t>
       Note: Section 8 and Section 9 of <xref target="I-D.irtf-pearg-numeric-ids-generation"/> provide a general vulnerability assessment of transient numeric identifiers, along with a vulnerability assessment of common algorithms for generating transient numeric identifiers. 
</t>
</list>
</t>
<t>Recommend an algorithm for generating the aforementioned transient numeric identifiers that mitigates the vulnerabilities identified in the previous step, such as those discussed in <xref target="I-D.irtf-pearg-numeric-ids-generation"/>.</t>
</list>
</t>



</section>


	<section title="IANA Considerations" anchor="iana-considerations">
<t>There are no IANA registries within this document. The RFC-Editor can remove this section before publication of this document as an RFC.</t>
</section>



    <section title="Security Considerations">

	<t>This document formally updates <xref target="RFC3552"/> such
    that a vulnerability assessment of transient numeric
    identifiers is performed when writing the "Security Considerations"
    section of future RFCs.</t>

    </section>

    <section title="Acknowledgements">
<t>The authors would like to thank Bernard Aboba, Theo de Raadt, Russ Housley, Benjamin Kaduk, Charlie Kaufman, and Joe Touch, for providing valuable comments on earlier versions of this document.</t>

<t>The authors would like to thank (in alphabetical order) Steven Bellovin, Joseph Lorenzo Hall, Gre Norcie, for providing valuable comments on <xref target="I-D.gont-predictable-numeric-ids"/> , on which the present document is based.</t>

<t>The authors would like to thank Diego Armando Maradona for his magic and inspiration.</t>


    </section>


  </middle>

  <back>
  <references title='Normative References'>
	<?rfc include="reference.RFC.2119" ?>
	<?rfc include="reference.RFC.8174" ?>


<!-- Sec Cons -->
	<?rfc include="reference.RFC.3552" ?>



<!--
	<?rfc include="reference.RFC.4086" ?>
-->


<!--
	<?rfc include="reference.RFC.6151" ?>
	<?rfc include="reference.RFC.7098" ?>
-->





  </references>

  <references title='Informative References'>

<!-- IPv6 IIDs  -->
	<?rfc include="reference.RFC.7721" ?>
	<?rfc include="reference.RFC.7217" ?>
	<?rfc include="reference.RFC.7707" ?>


<!-- Frag IDs -->
	<?rfc include="reference.RFC.6274" ?>
	<?rfc include="reference.RFC.7739" ?>
	<reference anchor="Sanfilippo1998a" target="http://seclists.org/bugtraq/1998/Dec/48">
		<front>
			<title>about the ip header id</title>
			<author initials="S." surname="Sanfilippo" fullname="S. Sanfilippo">
				<organization></organization>
			</author>
			<date/>
		</front>
		<seriesInfo name="Post to Bugtraq mailing-list," value="Mon Dec 14 1998" />
	</reference>

<!-- TCP sequence numbers -->
	<?rfc include="reference.RFC.0793" ?>
	<?rfc include="reference.RFC.6528" ?>  <!-- TCP SEQ randomization -->

	<reference anchor="Bellovin1989" target="https://www.cs.columbia.edu/~smb/papers/ipext.pdf">
		<front>
			<title>Security Problems in the TCP/IP Protocol Suite</title>
			<author initials="S." surname="Bellovin" fullname="Bellovin">
				<organization></organization>
			</author>
			<date year="Computer Communications Review, vol. 19, no. 2, pp. 32-48, 1989"/>
		</front>
	</reference>
		
	<reference anchor="Morris1985" target="https://pdos.csail.mit.edu/~rtm/papers/117.pdf">
		<front>
			<title>A Weakness in the 4.2BSD UNIX TCP/IP Software</title>
			<author initials="R." surname="Morris" fullname="Robert Morris">
				<organization></organization>
			</author>
			<date year="1985"/>
		</front>
		<seriesInfo name="CSTR 117," value="AT&amp;T Bell Laboratories, Murray Hill, NJ"/>
	</reference>
	
	
<!-- IPv6 -->
	<?rfc include="reference.RFC.2460" ?>


		<!-- Port randomization -->
	<?rfc include="reference.RFC.6056" ?>
	<reference anchor="Silbersack2005" target="http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.91.4542&amp;rep=rep1&amp;type=pdf">
		<front>
			<title>Improving TCP/IP security through randomization without sacrificing interoperability</title>
			<author initials="M.J." surname="Silbersack" fullname="Michael James Silbersack">
				<organization>The FreeBSD Project</organization>
			</author>
			<date year="2005"/>
		</front>
		<seriesInfo name="EuroBSDCon 2005" value="Conference"/>
	</reference>
		

	<?rfc include="reference.I-D.gont-predictable-numeric-ids" ?>

<!--
	<?rfc include="reference.RFC.1321" ?>
-->


<!-- Pervasive Monitoring -->
	<?rfc include="reference.RFC.7258" ?>


<!-- DNS -->
	<?rfc include="reference.RFC.1035" ?> 

<!-- IPv6 addresses -->
	<?rfc include="reference.RFC.4291" ?> 

<!-- PNRG -->
<reference anchor="Klein2007" target="https://dl.packetstormsecurity.net/papers/attack/OpenBSD_DNS_Cache_Poisoning_and_Multiple_OS_Predictable_IP_ID_Vulnerability.pdf">
		<front>
			<title>OpenBSD DNS Cache Poisoning and Multiple O/S Predictable IP ID Vulnerability</title>
			<author initials="A." surname="Klein" fullname="Amit Klein">
				<organization>Trusteer</organization>
			</author>
			<date year="2007"/>
		</front>
</reference>

<reference anchor="Schuba1993" target="http://ftp.cerias.purdue.edu/pub/papers/christoph-schuba/schuba-DNS-msthesis.pdf">
		<front>
			<title>ADDRESSING WEAKNESSES IN THE DOMAIN NAME SYSTEM PROTOCOL</title>
			<author initials="C." surname="Schuba" fullname="Christoph Schuba">
				<organization></organization>
			</author>
			<date year="1993"/>
		</front>
</reference>

	<?rfc include="reference.I-D.irtf-pearg-numeric-ids-history" ?>
	<?rfc include="reference.I-D.irtf-pearg-numeric-ids-generation" ?>
	
	
		<reference anchor="IANA-PROT" target="https://www.iana.org/protocols">
		<front>
			<title>Protocol Registries</title>
			<author initials="" surname="IANA" fullname="IANA">
				<organization></organization>
			</author>

			<date/>

		</front>
<!--
		<seriesInfo name="" value="Federal Information Processing Standards Publication 180-4"/>
-->
	</reference>
	
 </references>

  </back>
</rfc>

