Re: [Ntp] New rev of the NTP port randomization I-D (Fwd: New Version Notification for draft-gont-ntp-port-randomization-01.txt)

Fernando Gont <fgont@si6networks.com> Wed, 29 May 2019 09:22 UTC

Return-Path: <fgont@si6networks.com>
X-Original-To: ntp@ietfa.amsl.com
Delivered-To: ntp@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 0DD4E1200CE for <ntp@ietfa.amsl.com>; Wed, 29 May 2019 02:22:25 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.9
X-Spam-Level:
X-Spam-Status: No, score=-1.9 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-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 LYdm-k_bM8Mj for <ntp@ietfa.amsl.com>; Wed, 29 May 2019 02:22:23 -0700 (PDT)
Received: from fgont.go6lab.si (fgont.go6lab.si [91.239.96.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 8FD7D12002E for <ntp@ietf.org>; Wed, 29 May 2019 02:22:22 -0700 (PDT)
Received: from [192.168.1.2] (unknown [149.140.222.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by fgont.go6lab.si (Postfix) with ESMTPSA id 13CE889E17; Wed, 29 May 2019 11:22:19 +0200 (CEST)
To: Danny Mayer <mayer@ntp.org>, ntp@ietf.org
References: <155841904754.12856.3727925672753047210.idtracker@ietfa.amsl.com> <9d21f083-4cba-1dd1-f5bb-c95984d3127b@si6networks.com> <9d74c6e3-244e-fdd7-184a-0572f4f144cd@ntp.org> <25275d68-8c18-1616-f226-dffe7e21091e@si6networks.com> <20190528174208.11253a67@rellim.com> <1a133133-5d6a-ca96-6c15-73e6933baffc@si6networks.com> <2794A95B-B118-40BD-AD60-DCB50CC32717@latt.net> <f03dbfbd-007a-fa81-f846-85079a59dddd@si6networks.com> <c4384ecc-2711-3479-df21-d6533f438418@ntp.org>
From: Fernando Gont <fgont@si6networks.com>
Openpgp: preference=signencrypt
Autocrypt: addr=fgont@si6networks.com; prefer-encrypt=mutual; keydata= mQINBE5so2gBEACzBQBLUy8nzgAzSZn6ViXT6TmZBFNYNqTpPRvTVtUqF6+tkI+IEd9N2E8p pXUXCd0W4dkxz6o7pagnK63m4QSueggvp881RVVHOF8oTSHOdnGxLfLeLNJFKE1FOutU3vod GK/wG/Fwzkv9MebdXpMlLV8nnJuAt66XGl/lU1JrNfrKO4SoYQi4TsB/waUQcygh7OR/PEO0 EttiU8kZUbZNv58WH+PAj/rdZCrgUSiGXiWUQQKShqKnJxLuAcTcg5YRwL8se/V6ciW0QR9i /sr52gSmLLbW5N3hAoO+nv1V/9SjJAUvzXu43k8sua/XlCXkqU7uLj41CRR72JeUZ4DQsYfP LfNPC98ZGTVxbWbFtLXxpzzDDT8i3uo7w1LJ2Ij/d5ezcARqw01HGljWWxnidUrjbTpxkJ9X EllcsH94mer728j/HKzC9OcTuz6WUBP3Crgl6Q47gY5ZIiF0lsmd9/wxbaq5NiJ+lGuBRZrD v0dQx9KmyI0/pH2AF8cW897/6ypvcyD/1/11CJcN+uAGIrklwJlVpRSbKbFtGC6In592lhu7 wnK8cgyP5cTU+vva9+g6P1wehi4bylXdlKc6mMphbtSA+T3WBNP557+mh3L62l4pGaEGidcZ DLYT2Ud18eAJmxU3HnM8P3iZZgeoK7oqgb53/eg96vkONXNIOwARAQABtCVGZXJuYW5kbyBH b250IDxmZ29udEBzaTZuZXR3b3Jrcy5jb20+iQJBBBMBAgArAhsjBQkSzAMABgsJCAcDAgYV CAIJCgsEFgIDAQIeAQIXgAUCTmylpQIZAQAKCRCuJQ1VHU50kv7wD/9fuNtTfxSLk3B3Hs3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wed, 29 May 2019 05:12:34 -0400
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1
MIME-Version: 1.0
In-Reply-To: <c4384ecc-2711-3479-df21-d6533f438418@ntp.org>
Content-Type: text/plain; charset="utf-8"
Content-Language: en-US
Content-Transfer-Encoding: 7bit
Archived-At: <https://mailarchive.ietf.org/arch/msg/ntp/k4ur7uqtJSa_igoqrJTaYtOmIb8>
Subject: Re: [Ntp] New rev of the NTP port randomization I-D (Fwd: New Version Notification for draft-gont-ntp-port-randomization-01.txt)
X-BeenThere: ntp@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: <ntp.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/ntp>, <mailto:ntp-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/ntp/>
List-Post: <mailto:ntp@ietf.org>
List-Help: <mailto:ntp-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/ntp>, <mailto:ntp-request@ietf.org?subject=subscribe>
X-List-Received-Date: Wed, 29 May 2019 09:22:25 -0000

On 29/5/19 04:42, Danny Mayer wrote:
> 
> On 5/29/19 12:18 AM, Fernando Gont wrote:
>> On 28/5/19 23:20, Majdi S. Abbas wrote:
>>> Randomizing the source port is pointless.  As Danny has noted, t1
>>> already acts as a 2^64 nonce on each client mode chime request.  This
>>> sufficiently hardens the unauthenticated case to an off path
>>> attacker.  If additional security is required, authentication (via
>>> classic PSK, or NTS modes) should be used.
>> Using predictable numeric identifiers is a bad habit. We have plenty of
>> history in this area and, as noted, it's quite interesting to see folks
>> pushing in this direction in 2019, when the tendency has been to
>> actually move away from predictable numeric IDs (TCP ISNs, transport
>> protocol numbers, DNS TxIDs, Frag IDs, etc.).
>>
>> Using predictable port numbers makes it easy for an attacker to infer
>> the "session id". You are just considering one possible attack scenario.
>>
> You are totally missing the point. The port numbers don't make NTP
> vulnerable. The "session id" does not exist here. 

Attackers need to know the four-tuple that was employed by the query.
That's a prerequisite for attacking NTP. When you *unnecessarily* employ
a predictable port on the client side, you are making the attacker's
life easier. Period.



> Instead NTP has an
> origin timestamp that an off-path attacker does not have access to.

That's *not* "instead". Port numbers identify the transport protocol
instance. The org timestamp is an protocol specific value.

What you're saying is the equivalent that we should not randomize TCP
source ports because we also do TCP ISN randomization. And such logic is
very flawed, of course.



> RFC6056 was probably developed as a result of the Kaminsky attack on DNS
> and the way we fixed that.

It wasn't.


> I noticed a number of people mentioned in
> that RFC who were involved in those changes. It doesn't say so but that
> RFC addresses shortcomings in those protocols that have small or
> non-existent nonces which is not the case for NTP. 

Huh? You are mixing up transport layer with app layer. Again: using
predictable numeric IDs is a bad idea.


NO matter what you do at upper layers, you shouldn't use predictable
numeric IDs. I can't believe that we are discussing this in 2019.



>>> Per session randomization doesn't resolve these issues -- the stated
>>> rationale for both the draft and filed CVE is hardening to off path
>>> attacks, which we've just covered.
>> If tomorrow a flaw were found in an NTP implementation, that happened
>> e.g. prior to the validation of the origin timestamp, I guess you are
>> going to argue that "that was out of scope"?
>>
> There is no session validation since this is UDP not TCP. A flaw in an
> NTP implementation that did not check that the timestamp matched would
> be a bug in that implementation and randomizing the source port is not
> going to change that. Furthermore the client needs the origin timestamp
> to find the match in its local memory in order to process the incoming
> packet. if it cannot find it, it will ignore the packet.

You missed my example. I was referring to, e.g. o possible a bug in the
NTP implementation, present *prior* to the validation of the org
timestamp (e.g., processing of malformed packet, etc.).


-- 
Fernando Gont
SI6 Networks
e-mail: fgont@si6networks.com
PGP Fingerprint: 6666 31C6 D484 63B2 8FB1 E3C4 AE25 0D55 1D4E 7492