Re: [tsvwg] Regarding DTLS and UDP options

Joe Touch <touch@isi.edu> Tue, 18 April 2017 20:01 UTC

Return-Path: <touch@isi.edu>
X-Original-To: tsvwg@ietfa.amsl.com
Delivered-To: tsvwg@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id B27261201F2 for <tsvwg@ietfa.amsl.com>; Tue, 18 Apr 2017 13:01:22 -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, HTML_MESSAGE=0.001, RP_MATCHES_RCVD=-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 Yx00_YABXXAQ for <tsvwg@ietfa.amsl.com>; Tue, 18 Apr 2017 13:01:21 -0700 (PDT)
Received: from nitro.isi.edu (nitro.isi.edu [128.9.208.207]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 0CB6F129442 for <tsvwg@ietf.org>; Tue, 18 Apr 2017 13:01:19 -0700 (PDT)
Received: from [128.9.184.37] ([128.9.184.37]) (authenticated bits=0) by nitro.isi.edu (8.13.8/8.13.8) with ESMTP id v3IK0Q1B003901 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Tue, 18 Apr 2017 13:00:27 -0700 (PDT)
To: Tom Herbert <tom@herbertland.com>
References: <CACL_3VFeJs7KzG9Bchh15bfZ3CmaOPWcfisEreNoGYK5CsEJ+g@mail.gmail.com> <4e36af95-84c3-bc7e-b18a-614f8bfab662@isi.edu> <58F48403.8080302@erg.abdn.ac.uk> <a0f656e8-e847-db54-6046-2078364d428b@isi.edu> <CALx6S36HYHdbGoJHNb+mVY6reu9RLikLxDJqrPgwO9tF1EfSgQ@mail.gmail.com> <8b1829ba-4e8d-5ee1-e24c-f42962f47dde@isi.edu> <CALx6S36=7KbTtv9QNUBTg6gPYQQighsPD_+mWNc=wUQTX70VBQ@mail.gmail.com> <8378ae17-c023-25a2-76e7-07b858916849@isi.edu> <CALx6S35chiqMtqKa+zahfZnLZrQzfYUF7D9m0QGbkwFVpRwHag@mail.gmail.com> <bfc36611-6817-fbf9-a9c7-5bdde179b665@isi.edu> <CALx6S34qAh0mXGi8nuRtTiorf_1TE4V0NQ1QhqCcW0hmxOgc-Q@mail.gmail.com> <58F5C07C.4000707@erg.abdn.ac.uk> <CALx6S35N5WYvPHzTNo+trUecGgFPWv+xyXu4uampijc2w=DoSw@mail.gmail.com> <cf24acdf-002c-f6ed-de20-d1193ea229a3@isi.edu> <CALx6S349mwFhZ6-2tmLjPLPz4YcX6efoZckRiEPW3y4A3nKKjA@mail.gmail.com> <a8a1a2db-52e0-85e0-2be5-4baff1d86222@isi.edu> <CALx6S347BcwmXbOW61N0YNPsB7mMwe1FiFsDvArdfPm5PUkOCA@mail.gmail.com>
Cc: "gorry@erg.abdn.ac.uk" <gorry@erg.abdn.ac.uk>, tsvwg <tsvwg@ietf.org>
From: Joe Touch <touch@isi.edu>
Message-ID: <9ac26200-fec0-25b0-164a-fc1271c26219@isi.edu>
Date: Tue, 18 Apr 2017 13:00:26 -0700
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0
MIME-Version: 1.0
In-Reply-To: <CALx6S347BcwmXbOW61N0YNPsB7mMwe1FiFsDvArdfPm5PUkOCA@mail.gmail.com>
Content-Type: multipart/alternative; boundary="------------DE9805A03260DE38BE67A2AA"
X-MailScanner-ID: v3IK0Q1B003901
X-ISI-4-69-MailScanner: Found to be clean
X-MailScanner-From: touch@isi.edu
Archived-At: <https://mailarchive.ietf.org/arch/msg/tsvwg/xiYLX_2bpYgInJXktG8uqzkaTYE>
Subject: Re: [tsvwg] Regarding DTLS and UDP options
X-BeenThere: tsvwg@ietf.org
X-Mailman-Version: 2.1.22
Precedence: list
List-Id: Transport Area Working Group <tsvwg.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/tsvwg>, <mailto:tsvwg-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/tsvwg/>
List-Post: <mailto:tsvwg@ietf.org>
List-Help: <mailto:tsvwg-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/tsvwg>, <mailto:tsvwg-request@ietf.org?subject=subscribe>
X-List-Received-Date: Tue, 18 Apr 2017 20:01:23 -0000

Hi Tom,


On 4/18/2017 12:33 PM, Tom Herbert wrote:
>> But I'm not sure I understand the example.
>>
> My example is should be simple packet:
>
> IP|UDP|UDP_payload|FRAG_option
>
> I think if a legacy host receives this they accept it as a regular UDP
> packet, if a host with support received it they see a UDP fragment
> packet. (This is UDP, not UDP LITE)
We already discuss this as a bad idea until you confirm FRAG support
with the other end of the socketpair.

Another solution is to only use FRAG with LITE, but that adds overhead
you might not need  - which is why I think the protocol spec should say
"SHOULD use FRAG with LITE" and "MAY use FRAG without LITE but only
where confirmed".

> My suggestion to use UDP checksum in combination with length to
> eliminate this ambiguity:
>
> Sender host:
> - Length includes UDP options
I'm guessing you mean IP length (which would have to); UDP length cannot
(we can't find the options and they'd be misinterpreted as user data by
legacy hosts).

> - UDP checksum covers everything up to IP length
But that's not the current definition, which means you'll break any UDP
checksum software/hardware (NATs, offload).
> - Checksum over UDP options is nonzero (add an option if necessary to
> force this)
> - Protocol agnostics HW checksum offload should just work


> Receiver that support options:
> - Note IP length != UDP length so options may be present
> - Validate checksum that covers everything up to IP length (sum to
> zero with pseudo header included)
> - Check IP options sum to non-zero
> - Requirements for validating UDP checksum have been met, UDP options
> are valid and checksummed
>
> Receive that does not support options:
> - Since IP options part summed to non-zero, UDP checksum will be bad,
> packet is simply dropped
That means you'll be dropped by NATs too... which is something the
current approach avoids.

> - This is equivalent to packet dropped because options not supported
>
> Now our attacker can either forge fragment or forge a normal packet,
> but not both at the same time. UDP checksum will only be valid for one
> of two interpretations.
Attackers can forge anything. Why would they bother with this sort of
stuff? Why wouldn't they just forge real content that all endpoints
would think is valid?

> In other words the combination of length and UDP checksum can be used
> to identify UDP options with high probability and disallows
> misinterpretation scenario above. This also will work with HW checksum
> offload and obviates the need to have separate checksum in the UDP
> options.
I'm still missing something here.

A forger can forge anything it wants (again, presuming no UDP AE or
IPsec). It can forge both a fragment and a normal packet and send them
both in - thus interfering with either receiver variant. I don't see
what's magic about a single packet that both endpoints interpret - but
if that's the concern, the FRAG/LITE already avoids that and can be used.

Joe