Re: [TLS] Another ClientHello length intolerance bug?

David Benjamin <davidben@chromium.org> Wed, 12 September 2018 16:38 UTC

Return-Path: <davidben@google.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 91599130E87 for <tls@ietfa.amsl.com>; Wed, 12 Sep 2018 09:38:42 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -9.26
X-Spam-Level:
X-Spam-Status: No, score=-9.26 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.25, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, T_DKIMWL_WL_HIGH=-0.01, USER_IN_DEF_SPF_WL=-7.5] autolearn=no autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=chromium.org
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 eZH4VVFj-H8v for <tls@ietfa.amsl.com>; Wed, 12 Sep 2018 09:38:41 -0700 (PDT)
Received: from mail-it0-x241.google.com (mail-it0-x241.google.com [IPv6:2607:f8b0:4001:c0b::241]) (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 33AD4130DF3 for <tls@ietf.org>; Wed, 12 Sep 2018 09:38:41 -0700 (PDT)
Received: by mail-it0-x241.google.com with SMTP id f14-v6so3913184ita.4 for <tls@ietf.org>; Wed, 12 Sep 2018 09:38:41 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=bYw7/sh98Dk7boLyb6Uk8r7WxYkx6ghDwXhYMiGAEZk=; b=GPUOSxm/jV1yWFcOrg2vG4CsnMFQOlpwnQyax3cMvfVQtov5K9qMZWAfrPEUKlJrEx TcAn8+9OsyjEZeA7/9JZM7z6FRU/hdKIN3F//SrgPHUcXLHoLMh00N2AughN5lkqSRVb BII+I+YqBdvKpIbox/4uMWBVpzZs/84E3VinQ=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=bYw7/sh98Dk7boLyb6Uk8r7WxYkx6ghDwXhYMiGAEZk=; b=FknIPEw1QxhlTvw7TWUGexCTTSvPlEl0ajmBeDcx/gD72uglhSb/yRdDnGNL281S9Y 0O0vK3jWAba+wLzyqIHwa6n0dUwccF7qU+/iOxkGHvEPiLhQiqJKoDrVFZY7TDkXNeQ3 a8/fjtKRZ+5t6besAIleBcU8dJ0QaDD9JAqmIRSTIHSVkmlpm6OYYvNFck5t0+2kwqAE BNYPc82MtMsh4Pv68QFdInDv59tloVBDKzIYmgFqSESTANLvpMsMZ6W6u44rMWmSMR5L fMEaC94hbTgkq0YEeTi+BnvqqLhGRRGXyzPJhTZ4o14IIlfW/vl+kMY9ITWcvdsMfXJA Tw2Q==
X-Gm-Message-State: APzg51CLiZ3LjtbCkF/z+1J5oCZNq1api7WdjROPAsom8AhMhU/wj3kJ ZGQ/9Lb1kQpc0GKvLGYgX4NQPIIp1miFbllsKNNZ
X-Google-Smtp-Source: ANB0VdbUxy9LtdekcxiRuR3mcfjcu22h97AO6aljo2UuNZF1wcRSan5lGz7JheQeUVeosXAOFloHNMZeU1oms1MbmaQ=
X-Received: by 2002:a02:4d1b:: with SMTP id l27-v6mr2686472jab.86.1536770320251; Wed, 12 Sep 2018 09:38:40 -0700 (PDT)
MIME-Version: 1.0
References: <43b796a4-156a-6f16-4426-07c3cece61ba@nist.gov>
In-Reply-To: <43b796a4-156a-6f16-4426-07c3cece61ba@nist.gov>
From: David Benjamin <davidben@chromium.org>
Date: Wed, 12 Sep 2018 11:38:28 -0500
Message-ID: <CAF8qwaCqEFvJE03W9=UxBD3BJY=oWcz7qpxbBOnN==CkkWToow@mail.gmail.com>
To: "David A. Cooper" <david.cooper@nist.gov>
Cc: "tls@ietf.org" <tls@ietf.org>
Content-Type: multipart/alternative; boundary="0000000000000b0c680575af394d"
Archived-At: <https://mailarchive.ietf.org/arch/msg/tls/Lj4WLw-WlW-FZ7kcv7o2Sk9ZZ30>
Subject: Re: [TLS] Another ClientHello length intolerance bug?
X-BeenThere: tls@ietf.org
X-Mailman-Version: 2.1.29
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: Wed, 12 Sep 2018 16:38:42 -0000

Wow! That's a bizarre one. I don't think we've run into this one before,
but, from your description, any given implementation would only have a
1/256 chance of hitting it on every ClientHello change.

10 is a newline, so perhaps some implementation is doing a terrible job
detecting TLS vs. some plaintext protocol. No idea about 14. (This kind of
broken and unsound protocol-guessing behavior appears to be sadly common.
Some buggy middlebox started misidentifying our ClientHellos as SIP when we
removed the pre-standard ChaCha20 cipher suites!)

Do you have an example server? It would be good to get the problematic
implementation fixed.

David

On Wed, Sep 12, 2018 at 9:24 AM David A. Cooper <david.cooper@nist.gov>
wrote:

> According to RFC 7685 there was at least one TLS implementation that would
> hang the connection if it received a ClientHello record with a
> TLSCiphertext.length between 256 and 511 bytes.
>
> During some recent testing I believe that I have come across a similar
> length intolerance bug. A number of servers seem to hang or close the
> connection if sent a ClientHello record with a TLSCiphertext.length of 266,
> 522, 778, ... (i.e., if TLSCiphertext.length *mod* 256 = 10). I have also
> encountered one server that will also hang the connection if sent a
> ClientHello record with a TLSCiphertext.length of 270, 526, 782 ... (i.e.,
> if TLSCiphertext.length *mod* 256 = 14).
>
> A test for this was just added to the development branch of testssl.sh (
> https://github.com/drwetter/testssl.sh) -- run testssl.sh with the
> "--grease" option.
>
> As the server banner being returned by the servers that seem to have this
> problem are not all the same it is my guess that it is actually some
> middlebox that the is the source of the problem.
>
> Has anyone else encountered this problem? We are trying to validate that
> this is a real bug (https://github.com/drwetter/testssl.sh/pull/1113)
>
> Thanks,
>
> David
>
> _______________________________________________
> TLS mailing list
> TLS@ietf.org
> https://www.ietf.org/mailman/listinfo/tls
>