Re: [TLS] A closer look at ROBOT, BB Attacks, timing attacks in general, and what we can do in TLS

Hubert Kario <hkario@redhat.com> Mon, 08 January 2018 12:29 UTC

Return-Path: <hkario@redhat.com>
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 1806A12778E for <tls@ietfa.amsl.com>; Mon, 8 Jan 2018 04:29:37 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -6.911
X-Spam-Level:
X-Spam-Status: No, score=-6.911 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_HI=-5, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01] 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 c18gs0EUqvny for <tls@ietfa.amsl.com>; Mon, 8 Jan 2018 04:29:34 -0800 (PST)
Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id D54671243FE for <tls@ietf.org>; Mon, 8 Jan 2018 04:29:34 -0800 (PST)
Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 09EA54667D; Mon, 8 Jan 2018 12:29:34 +0000 (UTC)
Received: from pintsize.usersys.redhat.com (ovpn-200-24.brq.redhat.com [10.40.200.24]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 81C685C1A1; Mon, 8 Jan 2018 12:29:33 +0000 (UTC)
From: Hubert Kario <hkario@redhat.com>
To: Colm MacCárthaigh <colm@allcosts.net>
Cc: tls@ietf.org
Date: Mon, 08 Jan 2018 13:29:26 +0100
Message-ID: <2864671.ZroJSGrFQg@pintsize.usersys.redhat.com>
In-Reply-To: <CAAF6GDewtxWyD__R08222YfYfS5E0tT+m9Zv33R-+rm_49mJ7Q@mail.gmail.com>
References: <CAAF6GDeeo2xjv1Xu7SFXVZ_zM=XUVJHT=eqH4_-G3+4UHsfvgg@mail.gmail.com> <323483915.3215386.1515068250003.JavaMail.zimbra@redhat.com> <CAAF6GDewtxWyD__R08222YfYfS5E0tT+m9Zv33R-+rm_49mJ7Q@mail.gmail.com>
MIME-Version: 1.0
Content-Type: multipart/signed; boundary="nextPart168384795.TJ92X92gWc"; micalg="pgp-sha512"; protocol="application/pgp-signature"
X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Mon, 08 Jan 2018 12:29:34 +0000 (UTC)
Archived-At: <https://mailarchive.ietf.org/arch/msg/tls/7NcFppsVTrMltiqASqS4vRCuLEg>
Subject: Re: [TLS] A closer look at ROBOT, BB Attacks, timing attacks in general, and what we can do in TLS
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, 08 Jan 2018 12:29:37 -0000

On Thursday, 4 January 2018 20:01:03 CET Colm MacCárthaigh wrote:
> On Thu, Jan 4, 2018 at 4:17 AM, Hubert Kario <hkario@redhat.com> wrote:
> > > No, I strongly disagree here. Firstly, frustrating attackers is a good
> > > definition of what the goal of security is. Some times increasing costs
> > 
> > for
> > 
> > > attackers does come at the cost of making things harder to analyze or
> > 
> > debug,
> > 
> > > but we shouldn't make the latter easier at the expense of the former.
> > 
> > No, the goal of security is to stop attacks from being successful, not
> > make them harder. Making attack harder is security through obscurity.
> > Something that definitely doesn't work for open source software.
> 
> Unless you're shipping one-time-pads around, cryptography is founded on
> making successful attacks highly improbable, but not impossible. There are
> measures of likelihood of key and plaintext recovery for all of the
> established algorithms. The delay approach is no different, and risk can be
> expressed in mathematical ways.  The numbers are lower, for sure, delays
> can add a security factor of maybe up to 2^40, but that's still very very
> effective and unlike encryption or hashes, do not have to withstand
> longterm attacks.

except that what we call "sufficiently hard plaintext recovery" is over triple 
of the security margin you're proposing as a workaround here

2^40 is doable on a smartphone, now
2^120 is not doable on a supercomputer, and won't be for a very long time
 
> This bears repeating: attempting to make OpenSSL rigorously constant time
> made it *less* secure.

yes, on one specific hardware type, because of a bug in implementation

I really hope you're not suggesting "we shouldn't ever build bridges because 
this one collapsed"...

also, for how long was it *less* secure? and for how long was it vulnerable to 
Lucky13?

> The LuckyMinus20 bug was much worse than the Lucky13
> bug the code was trying to fix. It would have been better to leave it
> un-patched (at least for TLS, maybe not DTLS). A delay in the error case on
> the other hand, would have made either issue un-exploitable in the real
> world. 

I'm sorry, you're saying that you're able to prove a negative?
Or to put it other way: "Anyone can invent a security system that he himself 
cannot break."

> Evaluating that trade-off takes a lots of "grey area" analysis
> though; one has to have a sense of judgement for how much risk a complex
> code change is "worth", being mindful that complex code changes come with
> their own risks.

"we shouldn't fix it because it's not completely broken" is how we get 
million+ strong botnets of systems that never got updated

and any issue with known exploit needs to be fixed
 
> > honestly, I consider this approach completely misguided. If you are OK
> > with
> > tying up a socket for 30 seconds, simply start a timer once you get the
> > original client hello (or the first message of second flight, in TLS 1.2),
> > close the socket if the handshake is not successful in 30 seconds. In case
> > of errors, send nothing, let it timeout. The only reason why this approach
> > to constant time error handling is not used is because most people are not
> > ok with tying up resources for so long.
> 
> This is real code we use in production; thankfully errors are very
> uncommon, but connections also cost very little, in part due to work done
> for DDOS and trickle attacks, a different kind of security problem.
> 
> Delaying to a fixed interval is a great approach, and emulates how clocking
> protects hardware implementations, but I haven't yet been able to succeed
> in making it reliable. It's easy to start a timer when the connection is
> accepted and to trigger the error 30 seconds after that, but it's hard to
> rule out that a leaky timing side-channel may influence the subsequent
> timing of the interrupt or scheduler systems and hence exactly when the
> trigger happens. If it does influence it, then a relatively clear signal
> shows up again, just offset by 30 seconds, which is no use.

*if*

in other words, this solution _may_ leak information (something which you can 
actually test), or the other solution that _does_ leak information, just 
slowly so it's "acceptable risk"
-- 
Regards,
Hubert Kario
Senior Quality Engineer, QE BaseOS Security team
Web: www.cz.redhat.com
Red Hat Czech s.r.o., Purkyňova 115, 612 00  Brno, Czech Republic