idnits 2.17.1 draft-ietf-ntp-refid-updates-02.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- ** The abstract seems to contain references ([RFC5905]), which it shouldn't. Please replace those with straight textual mentions of the documents in question. == There are 3 instances of lines with non-RFC2606-compliant FQDNs in the document. == There are 4 instances of lines with non-RFC6890-compliant IPv4 addresses in the document. If these are example addresses, they should be changed. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year -- The document date (December 4, 2017) is 2335 days in the past. Is this intentional? Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) == Missing Reference: 'RFC0791' is mentioned on line 344, but not defined Summary: 1 error (**), 0 flaws (~~), 4 warnings (==), 1 comment (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Internet Engineering Task Force H. Stenn 3 Internet-Draft Network Time Foundation 4 Intended status: Standards Track S. Goldberg 5 Expires: June 7, 2018 Boston University 6 December 4, 2017 8 Network Time Protocol REFID Updates 9 draft-ietf-ntp-refid-updates-02 11 Abstract 13 RFC 5905 [RFC5905], section 7.3, "Packet Header Variables", defines 14 the value of the REFID, the system peer for the responding host. In 15 the past, for IPv4 associations the IPv4 address is used, and for 16 IPv6 associations the first four octets of the MD5 hash of the IPv6 17 are used. There are at least three shortcomings to this approach, 18 and this proposal will address the three so noted. One is that 19 knowledge of the system peer is "abusable" information and should not 20 be generally available. The second is that the four octet hash of 21 the IPv6 address looks very much like an IPv4 address, and this is 22 confusing. The third is that a growing number of low-stratum servers 23 want to offer leap-smeared time to their clients, and there is no 24 obvious way to know if a server is offering accurate time or leap- 25 smeared time. 27 Status of This Memo 29 This Internet-Draft is submitted in full conformance with the 30 provisions of BCP 78 and BCP 79. 32 Internet-Drafts are working documents of the Internet Engineering 33 Task Force (IETF). Note that other groups may also distribute 34 working documents as Internet-Drafts. The list of current Internet- 35 Drafts is at https://datatracker.ietf.org/drafts/current/. 37 Internet-Drafts are draft documents valid for a maximum of six months 38 and may be updated, replaced, or obsoleted by other documents at any 39 time. It is inappropriate to use Internet-Drafts as reference 40 material or to cite them other than as "work in progress." 42 This Internet-Draft will expire on June 7, 2018. 44 Copyright Notice 46 Copyright (c) 2017 IETF Trust and the persons identified as the 47 document authors. All rights reserved. 49 This document is subject to BCP 78 and the IETF Trust's Legal 50 Provisions Relating to IETF Documents 51 (https://trustee.ietf.org/license-info) in effect on the date of 52 publication of this document. Please review these documents 53 carefully, as they describe your rights and restrictions with respect 54 to this document. Code Components extracted from this document must 55 include Simplified BSD License text as described in Section 4.e of 56 the Trust Legal Provisions and are provided without warranty as 57 described in the Simplified BSD License. 59 Table of Contents 61 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 62 1.1. The REFID . . . . . . . . . . . . . . . . . . . . . . . . 2 63 1.2. NOT-YOU REFID . . . . . . . . . . . . . . . . . . . . . . 3 64 1.3. IPv6 REFID . . . . . . . . . . . . . . . . . . . . . . . 4 65 1.4. Leap-Smear REFID . . . . . . . . . . . . . . . . . . . . 4 66 1.5. Requirements Language . . . . . . . . . . . . . . . . . . 5 67 2. The NOT-YOU REFID . . . . . . . . . . . . . . . . . . . . . . 5 68 2.1. Proposal . . . . . . . . . . . . . . . . . . . . . . . . 5 69 3. Augmenting the IPv6 REFID Hash . . . . . . . . . . . . . . . 6 70 3.1. Background . . . . . . . . . . . . . . . . . . . . . . . 6 71 3.2. Potential Problems . . . . . . . . . . . . . . . . . . . 7 72 3.3. Questions . . . . . . . . . . . . . . . . . . . . . . . . 7 73 4. The REFID sent to clients during a Leap-Smear . . . . . . . . 7 74 4.1. Background . . . . . . . . . . . . . . . . . . . . . . . 7 75 4.2. Leap Smear REFID . . . . . . . . . . . . . . . . . . . . 8 76 4.3. Questions . . . . . . . . . . . . . . . . . . . . . . . . 9 77 5. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 10 78 6. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 10 79 7. Security Considerations . . . . . . . . . . . . . . . . . . . 10 80 8. References . . . . . . . . . . . . . . . . . . . . . . . . . 10 81 8.1. Normative References . . . . . . . . . . . . . . . . . . 10 82 8.2. Informative References . . . . . . . . . . . . . . . . . 11 83 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 11 85 1. Introduction 87 1.1. The REFID 89 The interpretation of a REFID is based on the stratum, as documented 90 in RFC 5905 [RFC5905], section 7.3, "Packet Header Variables". The 91 core reason for the REFID in the NTP Protocol is to prevent a degree- 92 one timing loop, where server B decides to follow A as its time 93 source, and A then decides to follow B as its time source. 95 At Stratum 2+, which will be the case if two servers A and B are 96 exchanging timing information, then if server B follows A as its time 97 source, A's address will be B's REFID. When A uses IPv4, the default 98 REFID is A's IPv4 address. When A uses IPv6, the default REFID is a 99 four-octet digest of A's IPv6 address. Now, if A queries B for its 100 time, then A will learn that B is using A as its time source by 101 observing A's address in the REFID field of the response packet sent 102 by B. Thus, A will not select B as a potential time source, since 103 this would cause a timing loop. 105 1.2. NOT-YOU REFID 107 This REFID mechanism, however, also allows a third-party C to learn 108 that A is the time source that is being used by B. When A is using 109 IPv4, C can learn this by querying B for its time, and observing that 110 the REFID in B's response is the IPv4 address of A. Meanwhile, when 111 A is using IPv6, then C can again query B for its time, and then can 112 use an offline dictionary attack to attempt to determine the IPv6 113 address that corresponds to the digest value in the response sent by 114 B. C could construct the necessary dictionary by compiling a list of 115 publicly accessible IPv6 servers. Remote attackers can use this 116 technique to attempt to identify the time sources used by a target, 117 and then send spoofed packets to the target or its time source in an 118 attempt to disrupt time service, as was done e.g., in [NDSS16] or 119 [CVE-2015-8138]. 121 The REFID thus unnecessarily leaks information about a target's time 122 server to remote attackers. The best way to mitigate this 123 vulnerability is to decouple the IP address of the time source from 124 the REFID. To do this, a system can use an otherwise-impossible 125 value for its REFID, called the "not-you" value, when it believes 126 that a querying system is not its time source. 128 The NOT-YOU REFID proposal is backwards-compatible. It can be 129 implemented by one peer in an NTP association without any changes to 130 the other peer. 132 The NOT-YOU REFID proposal does have a small risk, in that a system 133 that might return NOT-YOU does not have perfect information, and it 134 is possible that the remote system peer is contacting "us" via a 135 different network interface. In this case, the remote system might 136 choose us as their system peer, and a degree-one timing loop will 137 occur. In this case, however, the two systems will spiral into worse 138 stratum positions with increasing root distances, and eventually the 139 loop will break. If any other systems are available as time servers, 140 one of them will become the new system peer. However, until this 141 happens the two spiraling systems will have degraded time quality. 143 1.3. IPv6 REFID 145 In an environment where all time queries made to a server can be 146 trusted, an operator might well choose to expose the real REFID. RFC 147 5905 [RFC5905], section 7.3, "Packet Header Variables", explains how 148 a remote system peer is converted to a REFID. It says: 150 If using the IPv4 address family, the identifier is the four-octet 151 IPv4 address. If using the IPv6 family, it is the first four 152 octets of the MD5 hash of the IPv6 address. ... 154 However, the MD5 hash of an IPv6 address often looks like a valid 155 IPv4 address. When this happens, an operator cannot tell if the 156 REFID refers to an IPv6 address or and IPv4. Specifically, the NTP 157 Project has received a report where the generated IPv6 hash decoded 158 to the IPv4 address of a different machine on the system peer's 159 network. 161 This proposal offers a way for a system to generate a REFID for a 162 IPv6 system peer that does not conflict with an IPv4-based REFID. 164 This proposal is not fully backwards-compatible. It SHOULD be 165 implemented by both peers in an NTP association. In the scenario 166 where A and B are peering using IPv6, where A is the system peer and 167 does not understand IPv6 REFID, and B is subordinate and is using 168 IPv6 REFID, A will not be able to determine that B is using A as its 169 system peer and a degree-one timing loop can form. 171 If both peers implement the IPv6 REFID this situation cannot happen. 173 [If at least one of the peers implements the proposed I-DO protocol 174 this situation cannot happen.] 176 1.4. Leap-Smear REFID 178 RFC 5905 [RFC5905] and earlier versions of NTP are the overwhelming 179 method of distributing time on networks. Leap Seconds will continue 180 to exist for a good number of years' time, and since the timescale 181 mandated by POSIX effectively ignores any instances where there are 182 not 86,400 seconds' time in a day something must be done to reliably 183 synchronize clocks during the application of leap second corrections. 184 One mechanism that has recently become visible to deal with the 185 insertion of a leap second is to apply the leap second using a 186 "smear", where the time reported by leap-second aware servers is 187 gradually adjusted so there is no major disruption to time 188 synchronization when processing a leap second. 190 While the proper handling of leap seconds can be expected from up-to- 191 date software and time servers, there are large numbers of out-of- 192 date software installations and systems that are just not able to 193 properly handle a leap second correction. 195 This proposal offers a way for a system to generate a REFID that 196 indicates that the time being supplied in the NTP packet already 197 contains an amount of leap smear correction, and what that amount is. 199 This proposal is backwards-compatible in all but poorly-designed NTP 200 networks. The entire point of providing NTP servers that offer leap- 201 smeared time in response to CLIENT requests is to provide smooth time 202 to clients that are unable to properly handle leap seconds. If an 203 operator is skilled enough to provide leap-smeared time to a subset 204 of clients that cannot properly handle leap seconds, they can be 205 expected to know enough to avoid using leap-smeared time between time 206 servers that are expected to be able to properly handle leap seconds. 207 Leap smears are expected to be implemented on a limited number of 208 time servers where there is a base of client systems that cannot 209 handle a leap second correction. Furthermore, even in a poorly- 210 designed NTP network the "window of risk" lasts only as long as it 211 takes for the leap second to be smeared. 213 1.5. Requirements Language 215 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 216 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 217 document are to be interpreted as described in RFC 2119 [RFC2119]. 219 2. The NOT-YOU REFID 221 2.1. Proposal 223 When enabled, this proposal allows the one-degree loop detection to 224 work and useful diagnostic information to be provided to trusted 225 partners while keeping potentially abusable information from being 226 disclosed to ostensibly uninterested parties. It does this by 227 returning the normal REFID to queries that come from trusted 228 addresses or from an address that the current system believes is its 229 time source (aka its "system peer"), and otherwise returning a 230 special IP address that is interpreted to mean "not you". The "not 231 you" IP address is 127.127.127.127 when the query is made from an 232 IPv4 address, or when the query is made from an IPv6 address whose 233 four-octet hash does not equal 127.127.127.127. The "not you" IP 234 address is 127.127.127.128 when the query is made from an address 235 whose four-octet hash equals 127.127.127.127. 237 This mechanism is correct and transparent when the system responding 238 with a NOT-YOU can accurately detect when it's getting a timing query 239 from its system peer. A querying system that uses IPv4 continues to 240 check that its IPv4 address does not appear in the REFID before 241 deciding whether to take time from the current system. A querying 242 system that uses IPv6 continues to check that the four-octet hash of 243 its IPv6 address does not appear in the REFID before deciding whether 244 to take time from the current system. However... 246 Use of the NOT-YOU REFID proposal will hide the current system's 247 system peer from querying systems that the current system believes 248 are not the current system's system peer. Should the current system 249 return the "not you" REFID to a query from its system peer, for 250 example in the case where the system peer sends its query from an 251 unexpected IP address, a one-degree timing loop can occur. Put 252 another way, the responding system has imperfect knowledge about 253 whether or not the sender is its system peer and there are cases 254 where it will offer a NOT-YOU response to its system peer, which can 255 then produce a degree-one timing loop. 257 Note that this mechanism fully supports degree-one loop detection in 258 the case where the responding NOT-YOU system can accurately detect 259 when it's getting a request from its system peer, and otherwise 260 provides the most basic diagnostic information to third parties. 262 3. Augmenting the IPv6 REFID Hash 264 3.1. Background 266 In a trusted network, the S2+ REFID is generated based on the network 267 system peer. RFC 5905 [RFC5905] says: 269 If using the IPv4 address family, the identifier is the four-octet 270 IPv4 address. If using the IPv6 family, it is the first four 271 octets of the MD5 hash of the IPv6 address. ... 273 This means that the IPv4 representation of the IPv6 hash would be: 274 b1.b2.b3.b4 . The proposal is that the system MAY also use 275 255.b2.b3.b4 as its REFID. This reduces the risk of ambiguity, since 276 addresses beginning with 255 are "reserved", and thus will not 277 collide with valid IPv4 on the network. 279 When using the REFID to check for a timing loop for an IPv6 280 association, if the code that checks the first four-octets of the 281 hash fails to match then the code must check again, using 0xFF as the 282 first octet of the hash. 284 3.2. Potential Problems 286 There is a 1 in 16,777,216 chance that the REFID hashes of two IPv6 287 addresses will be identical, producing a false-positive loop 288 detection. With a sufficient number of servers, the risk of this 289 problem becomes a non-issue. [The use of the NOT-YOU REFID and/or 290 the proposed "REFID Suggestion" or "I-DO" extension fields are ways 291 to mitigate this potential situation.] 293 Unrealistically, if only two instances of NTP are communicating via 294 IPv6 and system A implements this new IPv6 REFID hash and system B 295 does not, system B will not be able to detect this loop condition. 296 In this case, the two machines will slowly increase their Stratum 297 until they reach S16 and become unsynchronized. This situation is 298 considered to be unrealistic because, for this to happen, each system 299 would have to have only the other system available as a time source, 300 for example, in a misconfigured "orphan mode" setup. There is no 301 risk of this happening in an NTP network with 3 or more time sources, 302 or in a properly-configured "time island" setup. 304 3.3. Questions 306 Should we reference the REFID Suggestion and I-DO proposals here? 308 Should we ask IANA to allocate a pseudo Extension Field Type of 309 0xFFFF (for example) so the proposed "I-Do" exchange can report 310 whether or not the "IPv6 REFID Hash" is supported? 312 4. The REFID sent to clients during a Leap-Smear 314 4.1. Background 316 RFC 5905 [RFC5905] and earlier versions of NTP are the overwhelming 317 method of distributing time on networks. Leap Seconds will continue 318 to exist for a good number of years' time, and since the timescale 319 mandated by POSIX effectively ignores any instances where there are 320 not 86,400 seconds' time in a day, something must be done to reliably 321 synchronize clocks during the application of leap second corrections. 322 One mechanism for dealing with the application that has recently 323 become visible is to apply the leap second using a "smear", where the 324 time reported by leap-second aware servers is gradually adjusted so 325 there is no major disruption to time synchronization when processing 326 a leap second. 328 While the proper handling of leap seconds can be expected from up-to- 329 date software and time servers, there are large numbers of out-of- 330 date software installations and systems that are not able to properly 331 handle a leap second correction. 333 This proposal offers a way for a system to generate a REFID that 334 indicates that the time being supplied in the NTP packet already 335 contains an amount of leap smear correction, and what that amount is. 337 4.2. Leap Smear REFID 339 RFC 5905 [RFC5905] defines the data type of NTP time values in 340 Section 6, "Data Types": 342 All NTP time values are represented in twos-complement format, 343 with bits numbered in big-endian (as described in Appendix A of 344 [RFC0791]) fashion from zero starting at the left, or high-order, 345 position. ... 347 The 32 bit signed integer seconds portion and the 32 bit unsigned 348 fractional seconds portion, or 32:32 format is: 350 0 1 2 3 351 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 352 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 353 | Seconds | 354 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 355 | Fraction | 356 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 358 NTP Timestamp Format (32:32) 360 This format provides coverage for 136 years' time to a precision of 361 232 picoseconds. If a leap-second addition is being completely 362 smeared just before before the stroke of the next POSIX second then 363 the smear correction will be (0,1). [That's mathematical domain 364 range notation - how to cite it?] If this was the only way to apply 365 a leap smear correction then we could simply use an unsigned value to 366 represent the correction. But while the first popular leap smear 367 implementation applied the correction over an appropriate number of 368 hours' time before the actual leap second, so the system time was 369 again correct at the stroke of 00:00, that meant that the difference 370 between system time and UTC spent half of the duration of the smear 371 application at [.5,1) "off" of correct time. The second popular 372 implementation of the leap smear applied the first half-second 373 correction before the stroke of 00:00 for a correction range of 374 (0,.5] and the last half-second correction starting at the stroke of 375 00:00 for a [-.5,0) correction range. This also means we need a 376 signed value to represent the amount of correction. 378 The REFID of a system that is supplying smeared time to client 379 requests while leap-smear correction is active would be 254.b1.b2.b3, 380 where the three octets (b1, b2, and b3) are a 2:22 formatted value, 381 yielding 2 signed bits of integer time and 22 bits of unsigned 382 fractional subseconds, with a precision to 238 nanoseconds, or about 383 a quarter of a microsecond. Signed time is needed to implement the 384 mathematical range described in the previous paragraph. 386 [How should we cite the 2:22 notation? This is the same general 387 format that we use for NTP timestamps.] 389 The client is not expected to do anything with this information. 390 Indeed, the whole point of offering smeared time is that there is 391 reason to believe the clients are unable to properly handle a leap 392 second correction. In this case, clients cannot be expected to do 393 anything with data embedded in the REFID, either. However, 394 monitoring systems that use tools that show a host's system peer, 395 like the 'ntpq' and 'sntp' programs in the reference implementation, 396 [HMS: how to cite this?] can use this information to make sure that 397 clients are following a leap-smearing server and can see fairly 398 accurately what the smear is for each client. 400 Note that if an NTP server decides to offer smeared time corrections 401 to clients, it SHOULD only offer this time in response to CLIENT time 402 requests. An NTP server that is offering smeared time SHOULD NOT 403 send smeared time in any peer exchanges. Also, system that sync 404 their time via CLIENT requests SHOULD NOT be distributing time 405 (smeared or otherwise) to other systems. 407 We also note that during the application of a leap smear, the REFID 408 from a system offering smeared time cannot provide detection of a 409 timing loop. This is not expected to be a problem because time 410 server systems are not expected to make CLIENT connections with each 411 other, so they should not be receiving smeared time. Moreso, if a 412 time server is configured to make CLIENT connections to a server that 413 offers smeared time, with the mechanism described here it can detect 414 when it is getting smeared time, and either ignore time from that 415 source, or "undo" the leap smear correction and use the corrected 416 time for that sample. 418 This proposal is not an attempt to justify servers offering leap 419 smeared time. It is only an attempt to make it easy and visible to 420 identify when a server is offering or client is receiving smeared 421 time, and provide the client a means to know the amount of smear 422 correction as of the latest successful poll. 424 4.3. Questions 426 Should we ask IANA to allocate a pseudo Extension Field Type of 427 0xFFFE (for example) so the proposed "I-Do" exchange can report 428 whether or not this server will offer leap smeared time in response 429 to CLIENT time requests, identifying the amount of correction using 430 the above REFID? 432 5. Acknowledgements 434 For the "not-you" REFID, we acknowledge useful discussions with 435 Aanchal Malhotra and Matthew Van Gundy. 437 For the IPv6 REFID, we acknowledge Dan Mahoney (and perhaps others) 438 for suggesting the idea of using an "impossible" first-octet value to 439 indicate an IPv6 refid hash. 441 For the Leap Smear REFID, we acknowledge useful discussions with 442 Juergen Perlinger. 444 6. IANA Considerations 446 This memo makes no requests of IANA. 448 7. Security Considerations 450 Many systems running NTP are configured to return responses to timing 451 queries by default. These responses contain a REFID field, which 452 generally reveals the address of the system's time source if that 453 source is an IPv4 address. This behavior can be exploited by remote 454 attackers who wish to first learn the address of a target's time 455 source, and then attack the target and/or its time source. As such, 456 the "not-you" REFID proposal is designed to harden NTP against these 457 attacks by limiting the amount of information leaked in the REFID 458 field. 460 Systems running NTP should reveal the identity of their system in 461 peer in their REFID only when they are on a trusted network. The 462 IPv6 REFID proposal provides one way to do this, when the system peer 463 uses addresses in the IPv6 family. 465 8. References 467 8.1. Normative References 469 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 470 Requirement Levels", BCP 14, RFC 2119, 471 DOI 10.17487/RFC2119, March 1997, 472 . 474 [RFC5905] Mills, D., Martin, J., Ed., Burbank, J., and W. Kasch, 475 "Network Time Protocol Version 4: Protocol and Algorithms 476 Specification", RFC 5905, DOI 10.17487/RFC5905, June 2010, 477 . 479 8.2. Informative References 481 [CVE-2015-8138] 482 Van Gundy, M. and J. Gardner, "Network Time Protocol 483 Origin Timestamp Check Impersonation Vulnerability (CVE- 484 2015-8138)", in TALOS VULNERABILITY REPORT (TALOS- 485 2016-0077), 2016. 487 [NDSS16] Malhotra, A., Cohen, I., Brakke, E., and S. Goldberg, 488 "Attacking the Network Time Protocol", in ISOC Network and 489 Distributed System Security Symposium 2016 (NDSS'16), 490 2016. 492 Authors' Addresses 494 Harlan Stenn 495 Network Time Foundation 496 P.O. Box 918 497 Talent, OR 97540 498 US 500 Email: stenn@nwtime.org 502 Sharon Goldberg 503 Boston University 504 111 Cummington St 505 Boston, MA 02215 506 US 508 Email: goldbe@cs.bu.edu