Re: [tsvwg] Regarding DTLS and UDP options

Tom Herbert <tom@herbertland.com> Tue, 18 April 2017 19:33 UTC

Return-Path: <tom@herbertland.com>
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 5FB5E129C31 for <tsvwg@ietfa.amsl.com>; Tue, 18 Apr 2017 12:33:30 -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, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=herbertland-com.20150623.gappssmtp.com
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 aoG5mD1_vwwN for <tsvwg@ietfa.amsl.com>; Tue, 18 Apr 2017 12:33:28 -0700 (PDT)
Received: from mail-qt0-x22b.google.com (mail-qt0-x22b.google.com [IPv6:2607:f8b0:400d:c0d::22b]) (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 962331293D9 for <tsvwg@ietf.org>; Tue, 18 Apr 2017 12:33:28 -0700 (PDT)
Received: by mail-qt0-x22b.google.com with SMTP id g60so2638683qtd.3 for <tsvwg@ietf.org>; Tue, 18 Apr 2017 12:33:28 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=herbertland-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=8vrpnZcEaKP5IFyM1r01wmKUluGd7D1OxpCoMFr9+98=; b=u4+UefpDLs8pqjFxWWptTJ2aZ1RxR5NJz/B7IkJvYXTUnPPQAjWuM5PTlTPT0acGqm bVu473XBO5CFkIqFjujVqVdSt4F0Vtpy+UJH6VgCcM3j3IzZEF/1yAK7dWRSIrgQip+y /chGjBZcpr2bTlXiNRQa//5/U7tIUSlNT2Pgm25xkQn8UszX1rAfX20vtmgTXU4vRc7d U9+vLPRCoWw2FvVHfnKAkuJSEXw8SMWVe2wB8wWSXdK/k53EdfimvbfLtommRWAgdxTC 3VOY3JHW0rJr0/0PvhrRgscagfFRSiKYVIWxLra7i8mL3shh9n+9j66NDM6gBytjOYqC U0Ew==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=8vrpnZcEaKP5IFyM1r01wmKUluGd7D1OxpCoMFr9+98=; b=EzqE9boW04fEHQvv8aZHXYtVJb6s0VD0y1eweuAfQgx9Y1Z5Y8HxvwIywj03mx7Z6V 0D2Fisa2ykWyOjT/EF3+/FvUZGT9v6/QqBt154R0EN1kiGOXyeJHsHccNfORAEcICQTH 3KS0MGUlnRSEboX7+RaYFrC2lm+bUV869Pp2hcmEqrN9InqU/OS5oiJvgCf2sIfhLyau lJVpjJ5xcKEzzcTZYXZ3xn3ajEKAPjGzHl4qPNGY1UBShJxDdgTgwqF7b5AxZwdjxPyN MFX3BGERE4sBW0NJlGWmX4qwGBNKepm0/o+rIyvvvPuJSCXYiic3Woau+QJyr8vwor1J n0ew==
X-Gm-Message-State: AN3rC/5rS6sIUO77uKe1Vrz8JHWOTNMyjilm3NLztExcZyFToBqHy64G A14Dc4h5HUUyc7Ur4t+cN2htuC48iA==
X-Received: by 10.200.34.144 with SMTP id f16mr16471537qta.186.1492544007680; Tue, 18 Apr 2017 12:33:27 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.140.97.10 with HTTP; Tue, 18 Apr 2017 12:33:26 -0700 (PDT)
In-Reply-To: <a8a1a2db-52e0-85e0-2be5-4baff1d86222@isi.edu>
References: <CACL_3VFeJs7KzG9Bchh15bfZ3CmaOPWcfisEreNoGYK5CsEJ+g@mail.gmail.com> <CACL_3VHmoCSo23OWqQFq7upw749CqMK7iazXrBKZARzwbzY5mw@mail.gmail.com> <f97f08d4-0070-437a-e22a-8782497c76eb@isi.edu> <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>
From: Tom Herbert <tom@herbertland.com>
Date: Tue, 18 Apr 2017 12:33:26 -0700
Message-ID: <CALx6S347BcwmXbOW61N0YNPsB7mMwe1FiFsDvArdfPm5PUkOCA@mail.gmail.com>
To: Joe Touch <touch@isi.edu>
Cc: "gorry@erg.abdn.ac.uk" <gorry@erg.abdn.ac.uk>, tsvwg <tsvwg@ietf.org>
Content-Type: text/plain; charset="UTF-8"
Archived-At: <https://mailarchive.ietf.org/arch/msg/tsvwg/Nd3mH6FnmOfguPpyDOQVGWTpHIk>
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 19:33:30 -0000

On Tue, Apr 18, 2017 at 11:36 AM, Joe Touch <touch@isi.edu> wrote:
>
>
> On 4/18/2017 11:16 AM, Tom Herbert wrote:
>>> UDP packets and TCP packets can already be forged.
>>>
>>> If that's your concern, you need to use true transport-layer or network
>>> layer security.
>>>
>> 1) Yes, that is my concern. UDP is already dicey in terms of security,
>> the risks introduced with these extensions needs to be thoroughly
>> vetted before I'd ever deploy in my network
> Do you feel the same about new TCP options?
>
>> 2) It can't be a requirement to turn up security everywhere just to
>> use UDP options
> It isn't for new TCP options either, though.
>
>> 3) My example is a contrived attack against the new protocol that
>> might be deployed, the mitigations to defend such an attack should be
>> part of the protocol not deferred to some other layer
> The protocol extension already includes OCS and AE for that reason,
> though there's no way that UDP can protect the entire IP header too
> (that's what IPsec is designed for).
>
>>
>>> And endpoints can claim conformance all they want; forged packets are
>>> already noncompliant. No protocol is robust to forged packets except
>>> those that support authentication or encryption.
>>>
>> That's misses the crux of my argument. In my example, an attacker
>> forged a packet with can be "correctly" interpreted as either fragment
>> or a non-fragment. Which interpretation depends on the node that
>> processes it (sort of a Copenhagen Interpretation for network
>> protocols I suppose :-) ). But a packet cannot simultaneously be a
>> fragment and a not fragment, that is nonsensical (packets don't have
>> duality in this instance). This must be considered an error condition.
> The solution to your  example would be for the protocol to allow only
> the hidden FRAG mechanism. Right now that's optional.
>
> However, note that forged packet can add a new extension that has two
> effects - one for upgraded endpoints, one for legacy - already. In TCP.
>
> The solution to *that* ambiguity is to confirm new options before using
> them and use them only when confirmed - as noted in Section 10.
>
>> This ambiguity does not occur in IP or IPv6 and has been introduced by
>> the protocol specification not incorrect implementation.
> It occurs the same way you could forge a new IP option that is accepted
> or ignored, depending on the endpoint support.
>
>> It's unlikely
>> in practice that this would cause problems, however, as I mentioned
>> above, if this can be exploited as a security vulnerability that will
>> be a concern of mine.
>>
>> I thought a one point there was the idea that the UDP checksum would
>> be incorrect so that in the case I describe above a fragment would be
>> dropped and not misinterpreted by a node that doesn't support
>> fragments. Is there a reason that wouldn't work?
>
> I'm not sure - again, I think your concerns about misinterpreting the
> data are addressed by allowing only FRAG as LITE.
>
> 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)

My suggestion to use UDP checksum in combination with length to
eliminate this ambiguity:

Sender host:
- Length includes UDP options
- UDP checksum covers everything up to IP length
- 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
- 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.

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.

Tom





> Consider that if I can forge a FRAG, I can forge an entire UDP packet. I
> don't need anything new to have this vulnerability.
>
> Joe
>