Re: [TLS] draft-ietf-tls-tls13-21: TLS 1.3 record padding removal leaks padding size

Colm MacCárthaigh <colm@allcosts.net> Mon, 14 August 2017 22:55 UTC

Return-Path: <colm@allcosts.net>
X-Original-To: tls@ietfa.amsl.com
Delivered-To: tls@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id B3EB2132448 for <tls@ietfa.amsl.com>; Mon, 14 Aug 2017 15:55:53 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.6
X-Spam-Level:
X-Spam-Status: No, score=-2.6 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_LOW=-0.7] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=allcosts-net.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 7nK0flvOIlKo for <tls@ietfa.amsl.com>; Mon, 14 Aug 2017 15:55:52 -0700 (PDT)
Received: from mail-yw0-x22b.google.com (mail-yw0-x22b.google.com [IPv6:2607:f8b0:4002:c05::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 0C84013241C for <tls@ietf.org>; Mon, 14 Aug 2017 15:55:51 -0700 (PDT)
Received: by mail-yw0-x22b.google.com with SMTP id p68so63590143ywg.0 for <tls@ietf.org>; Mon, 14 Aug 2017 15:55:51 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=allcosts-net.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=wBwfXLWocLfhwK6wosBB8avGImnFjSpp+UbONmCXDIM=; b=CmVYYFRLm1Qg+CORfKVoYHY5sCJLFGBCS1FI8H9TtOcMGT95i2rjKfnXqEIiazreDC 0Y3jwwQotY1fmvGPsjxt2AB8ugd638otcORWSUcnyIsxdQhn5wk0yDwqwTpIohqYk0ag 9BOcWwRDCH7vyXaxriXWgQR/Wv4DNDsrcToLOj8Otot1HybbGf4OuRoF9OrFjwLajzsJ u/wzCqd1ZFefHAGddb9n7CSPPnNYei3fspBh9YpuIaJ7kvPM6NJ3NOeIALcUYJkHb1h4 gDBspJdLjWnGZZ4Mhr73EnaWBWk9HtgP3d7/z1u0W8XSv+n/3RDDEkjrJGMoEpJ52rgp SOXQ==
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=wBwfXLWocLfhwK6wosBB8avGImnFjSpp+UbONmCXDIM=; b=crRfvCqrUMj5CJ//7D5az8znNx96Z8CKRCviZsC8QdQJ4zkcd+nGjrr0f7DBRGV8CP BD3CPXOMkwm094/dbXHu6RJ7qV9piQp1VUDdiEYcWJMn4Nby7vr6paVVbX1xzpZAai51 RBz0CGF7m6g3rJNJHfYzlGRJlzK9HJ6pRdMz4RcRjpBYmiMDFWngo/MbYJFeYPY+a5ri mQCz85drwpASffA4ysmwToTUVYll4an7CiSy2Q5rPGxWOZyI7XYU1zWk8ATqbk2afqYK iUrQf1OT29dOEsOu11cbW094evLnrAMvzqwxGDtPnhKII6vf5AoWz/cFCxgtsqL76Z1Z bmGA==
X-Gm-Message-State: AHYfb5gqbKlLZw34AWMtIqgVRN7Ry/n3jEKy92c1dnOsdqgbLaa+n/UQ aJEg4hTM7yVxPYEFt3IRqs5f/hI3d3t/
X-Received: by 10.37.207.82 with SMTP id f79mr21571921ybg.103.1502751351013; Mon, 14 Aug 2017 15:55:51 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.129.154.71 with HTTP; Mon, 14 Aug 2017 15:55:50 -0700 (PDT)
In-Reply-To: <2492694.vcgQpB2T86@pintsize.usersys.redhat.com>
References: <1502460670.3202.8.camel@redhat.com> <CABcZeBNpJ5_03VZot_3hj7KHnJ8609HX-MY62n0+HLXoRg-+=Q@mail.gmail.com> <14329E27-DBCC-4A6F-BB4C-7CFAFD7ADF53@akamai.com> <2492694.vcgQpB2T86@pintsize.usersys.redhat.com>
From: Colm MacCárthaigh <colm@allcosts.net>
Date: Tue, 15 Aug 2017 00:55:50 +0200
Message-ID: <CAAF6GDcsRpC1m2P9v9BF6=5CRiS8eP-B7awZ_x4RoUkOc09DEQ@mail.gmail.com>
To: Hubert Kario <hkario@redhat.com>
Cc: "tls@ietf.org" <tls@ietf.org>
Content-Type: text/plain; charset="UTF-8"
Archived-At: <https://mailarchive.ietf.org/arch/msg/tls/AEAgInfqymtHBjkYJ3MyL0eDhjI>
Subject: Re: [TLS] draft-ietf-tls-tls13-21: TLS 1.3 record padding removal leaks padding size
X-BeenThere: tls@ietf.org
X-Mailman-Version: 2.1.22
Precedence: list
List-Id: "This is the mailing list for the Transport Layer Security working group of the IETF." <tls.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/tls>, <mailto:tls-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/tls/>
List-Post: <mailto:tls@ietf.org>
List-Help: <mailto:tls-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/tls>, <mailto:tls-request@ietf.org?subject=subscribe>
X-List-Received-Date: Mon, 14 Aug 2017 22:55:54 -0000

On Mon, Aug 14, 2017 at 8:16 PM, Hubert Kario <hkario@redhat.com> wrote:
> the difference in processing that is equal to just few clock cycles is
> detectable over network[1]

The post you reference actually says the opposite; "20 CPU cycles is
probably too small to exploit" ... and even today with very low
latency networks and I/O schedulers it remains very difficult to
measure that kind of timing difference remotely. But per the post, the
larger point is that it is prudent to be cautious.

> When you are careful on the application level (which is fairly simple when you
> just are sending acknowledgement message), the timing will still be leaked.

There are application-level and tls-implementation-level approaches
that can prevent the network timing leak. The easiest is to only write
TLS records during fixed period slots.

For example, suppose your process can handle 100 connections
concurrently, then you can divide 1ms into 100 slots of 10
microseconds each. Every 1ms you have a writer thread or process
'visit' each connection (you may use an epoll/kqueue driven I/O loop
or similar for this) during its fixed slot and send its pending
output.

-- 
Colm