Re: [tcpm] [tcpinc] TCP Stealth - possible interest to the WG

Christian Grothoff <christian@grothoff.org> Tue, 19 August 2014 17:52 UTC

Return-Path: <christian@grothoff.org>
X-Original-To: tcpm@ietfa.amsl.com
Delivered-To: tcpm@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 3CFA11A0675; Tue, 19 Aug 2014 10:52:43 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -3.85
X-Spam-Level:
X-Spam-Status: No, score=-3.85 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, HELO_EQ_DE=0.35, RCVD_IN_DNSWL_MED=-2.3] autolearn=ham
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 CXEtcKlkwiLe; Tue, 19 Aug 2014 10:52:41 -0700 (PDT)
Received: from smtp1.informatik.tu-muenchen.de (mail-out1.informatik.tu-muenchen.de [131.159.0.8]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 32F5C1A067B; Tue, 19 Aug 2014 10:52:39 -0700 (PDT)
Received: from [192.168.178.20] (pd95c0f92.dip0.t-ipconnect.de [217.92.15.146]) by mail.net.in.tum.de (Postfix) with ESMTPSA id B0FED191C878; Tue, 19 Aug 2014 19:52:34 +0200 (CEST)
Message-ID: <53F38EE3.9060300@grothoff.org>
Date: Tue, 19 Aug 2014 19:52:35 +0200
From: Christian Grothoff <christian@grothoff.org>
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Icedove/24.7.0
MIME-Version: 1.0
To: "Scheffenegger, Richard" <rs@netapp.com>, Hagen Paul Pfeifer <hagen@jauu.net>, "alfiej@fastmail.fm" <alfiej@fastmail.fm>
References: <ecdbe694b6964c159f64b1d3311c8cc6@hioexcmbx02-prd.hq.netapp.com> <CAFggDF2jhQPz0Eez=AU9M-k862wD_=VSyVpXtRAjT4zC6H4tgA@mail.gmail.com> <1408397675.299896.154112109.6F69043F@webmail.messagingengine.com> <8c5f6a1e9f2340e48e25dd151406b7d3@hioexcmbx05-prd.hq.netapp.com> <1408401991.317123.154137701.0A30F30C@webmail.messagingengine.com> <CAPh34meB=EtgNu=_eBS6ekB20fRccAqXFWydkCWG+6VKSa98rg@mail.gmail.com> <651312c598e44d05af8212c2eb691001@hioexcmbx05-prd.hq.netapp.com>
In-Reply-To: <651312c598e44d05af8212c2eb691001@hioexcmbx05-prd.hq.netapp.com>
X-Enigmail-Version: 1.6
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
Archived-At: http://mailarchive.ietf.org/arch/msg/tcpm/fCsWl7ZKsDTJBH2YtqZijC_qX9M
X-Mailman-Approved-At: Wed, 20 Aug 2014 08:02:47 -0700
Cc: "tcpinc@ietf.org" <tcpinc@ietf.org>, "tcpm (tcpm@ietf.org)" <tcpm@ietf.org>, Joe Touch <touch@isi.edu>
Subject: Re: [tcpm] [tcpinc] TCP Stealth - possible interest to the WG
X-BeenThere: tcpm@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: TCP Maintenance and Minor Extensions Working Group <tcpm.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/tcpm>, <mailto:tcpm-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/tcpm/>
List-Post: <mailto:tcpm@ietf.org>
List-Help: <mailto:tcpm-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/tcpm>, <mailto:tcpm-request@ietf.org?subject=subscribe>
X-List-Received-Date: Tue, 19 Aug 2014 17:52:43 -0000

On 08/19/2014 07:20 PM, Scheffenegger, Richard wrote:
> Hi Hagen,
> 
>> Anyway, I am little bit ambivalent regarding this ID. It may help
>> in some situations and reduce the attack vector. Any effort to
>> improve the security should be reviewed! I mean if there are no
>> negative impacts: why not? ;-)
> 
> I'm reluctant to conclude that there are no negative impacts.
> 
> As an example, think of a lightweight http server running this on a
> server, an legimtate client (knowing the secret) running on a similar
> leightweight client without TSopt and only very few ephemeral ports.
> 
> For each http session, the very same ISN will be re-used for every
> identical source port.

No, that is nonsense, you are constructing a pretty narrow scenario.
First of all, with integrity protection, the client can include the
first N bytes of the HTTP header in what is hashed into the ISN, so
different URLs would created different ISNs.

Furthermore, even without integrity protection, the client should
use the TCP timestamp option, which will add another 32-bits of
entropy to the hash, making each new request have a very much random
ISN.

Finally, I question that it is realistic that a client will
1) create SO MANY connections to an administrative service
   (sign of BAD application-level protocol design) that
   the number of available ephemeral source ports is exceeded
   before connections can be properly timed out;
2) not be able to enable TSopt
3) not be able to use integrity protections

You need _all_ of these.   And note that using TCP Stealth is supposed
to be an option that applications can enable, not something every server
has to require for every TCP client. So if the above scenario really
is what happens, just don't use it.

> In that enviornment the chances for a delayed packet to corrupt a
> TCP
stream are non-negligible any more... ( the inverse of the number of
ephemeral source ports available).

Btw, isn't a proper TCP implementation supposed to not re-use ephemeral
ports for a sufficiently long time out to ensure this cannot happen,
regardless of ISN collision possibilities?  After all, the ISN almost
doesn't matter here, as the connection might have been used to transfer
4 GB and then _every_ ISN may cause this problem.  So I think you are
considering the case of a very, very broken TCP client implementation.

> Also, the client will have to do a fall-back SYN without TSopt, if an
> intermediate meddlebox modifies the TSopt in any way; and across
> normalizers (also not completely uncommon) the scheme breaks down.
> But then, those meddleboxes shouldn't really be messing around to
> begin with... :)

Exactly.

> 
> I guess what I'm saying is that if some randomness (high order bits)
> could be maintained even when the 4-tuples are identical, that would
> at least address this concern (such sessions would still be
> detectable, by checking if the low order bits are identical; unless
> there is some clever way to randomly distribute the hash-bits and
> random bits, perhaps also based on a (different?) hash of the
> 4-tuple...

Look, with TSval and optionally hashing in the content, you do have
already two good ways to increase entropy.  A third way would be if the
application-logic decides to change the secret after each successful
connection (one-time secrets), which for _some_ scenarios with only one
legitimate user of the TCP server is also realistic.

Happy hacking!

Christian