Re: [TLS] TLS grammar checker?

Nico Williams <nico@cryptonector.com> Wed, 19 June 2013 00:16 UTC

Return-Path: <nico@cryptonector.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 4F0D621E80AD for <tls@ietfa.amsl.com>; Tue, 18 Jun 2013 17:16:35 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.591
X-Spam-Level:
X-Spam-Status: No, score=-1.591 tagged_above=-999 required=5 tests=[AWL=-0.365, BAYES_00=-2.599, FM_FORGED_GMAIL=0.622, SARE_OBFU_ALL=0.751]
Received: from mail.ietf.org ([12.22.58.30]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id WYXgSi2gnLTW for <tls@ietfa.amsl.com>; Tue, 18 Jun 2013 17:16:30 -0700 (PDT)
Received: from homiemail-a71.g.dreamhost.com (caiajhbdcaid.dreamhost.com [208.97.132.83]) by ietfa.amsl.com (Postfix) with ESMTP id AD63221F99AF for <tls@ietf.org>; Tue, 18 Jun 2013 17:16:25 -0700 (PDT)
Received: from homiemail-a71.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a71.g.dreamhost.com (Postfix) with ESMTP id 6691B428072 for <tls@ietf.org>; Tue, 18 Jun 2013 17:16:23 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=cryptonector.com; h= mime-version:in-reply-to:references:date:message-id:subject:from :to:cc:content-type; s=cryptonector.com; bh=rT6DmbF50RhIZUMmHtHc DPcRsXM=; b=QqiGGmRVjdbcPHDAL8U4iKRfMvGBfkkXPR4lXxNZwPfdO+VvH/Pw JiAH0gqs0MPYbfmmNb5NBHAxxu+PoETs4beyLFFsT9ipl9W2EQ494u4m1GJ8AWVe Qp4nrRp6pS0hk9MynKHxv+WCVE9/jdRhxXdRE0pAUIo/E7OkJrIwFiI=
Received: from mail-wg0-f52.google.com (mail-wg0-f52.google.com [74.125.82.52]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: nico@cryptonector.com) by homiemail-a71.g.dreamhost.com (Postfix) with ESMTPSA id 1194D42806E for <tls@ietf.org>; Tue, 18 Jun 2013 17:16:22 -0700 (PDT)
Received: by mail-wg0-f52.google.com with SMTP id b12so4010972wgh.19 for <tls@ietf.org>; Tue, 18 Jun 2013 17:16:21 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=8Jn4hZ9tdpaAYkrg6uObPubjzh2tnI6snetY57x95ic=; b=aCQmN9Zw+ybFDFmjWkTL6iFLyJUnS4MavW2V4MsJUpcO/8R4vPGN9YSIfYtYT9jsG4 UaP0icorXgG38r1m83rffbw8g7DYGwq6Hn2lglS+iP33CE0nAxD7qCfcimZM6K1UMMet krxaparCTS+R8u1mQt3tVGByy2EA0FAvtgHYflfMB0hSFew+Gp6wxUUeioE/bjwE+//T MnBxy6ngMicRxwj2tKJin72ly6srzO4n3mp5/yM2Y0nMborb51KfbakQuOlsGzQaEiN6 zlm/rtf4ELQ4gvf58gFIfq2/p6Qv4+sk1+lQP8Hi/8bbzCy1MGoq5Szb2HXkFfpTU78u r6qA==
MIME-Version: 1.0
X-Received: by 10.181.12.1 with SMTP id em1mr9254902wid.4.1371600981468; Tue, 18 Jun 2013 17:16:21 -0700 (PDT)
Received: by 10.216.29.5 with HTTP; Tue, 18 Jun 2013 17:16:21 -0700 (PDT)
In-Reply-To: <r422Ps-1075i-3AFF88CCA21845BB9D2515C6C2709DA6@Williams-MacBook-Pro.local>
References: <201306182327.r5INR5RO007548@mail172c38.carrierzone.com> <r422Ps-1075i-3AFF88CCA21845BB9D2515C6C2709DA6@Williams-MacBook-Pro.local>
Date: Tue, 18 Jun 2013 19:16:21 -0500
Message-ID: <CAK3OfOj82obkjVipLxsn_yfwA_YnT-J1n0orJj9p00X5s3v26g@mail.gmail.com>
From: Nico Williams <nico@cryptonector.com>
To: Bill Frantz <frantz@pwpconsult.com>
Content-Type: text/plain; charset="UTF-8"
Cc: "tls@ietf.org" <tls@ietf.org>
Subject: Re: [TLS] TLS grammar checker?
X-BeenThere: tls@ietf.org
X-Mailman-Version: 2.1.12
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: <http://www.ietf.org/mail-archive/web/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, 19 Jun 2013 00:16:35 -0000

On Tue, Jun 18, 2013 at 7:05 PM, Bill Frantz <frantz@pwpconsult.com> wrote:
> On 6/18/13 at 4:26 PM, uri@ll.mit.edu (Blumenthal, Uri - 0558 - MITLL)
> wrote:
>
>> Having written my share of ASN.1 stuff (including parser/encoder with no
>> known vulnerabilities :), I agree with Nico's assessment of ASN.1.
>
>
> No known vulnerabilities is a good start. Unfortunately a lot of software is
> released with no know vulnerabilities but doesn't hold up under attack. It
> is nice to hear of software that has survived attack with no known
> vulnerabilities.

Automatic tooling is a better start.  I.e., ASN.1, XDR, IDL, ... compilers.

Ad-hoc syntaxes don't lend themselves to automatic tooling, so they
tend to result in lots of error-prone hand-coding.

What are you arguing for?  (Mind you, this really isn't the right
place...  that goes for me too)

>> The syntax itself is fine as far as security goes.  It's not terribly
>> easy to parse (so that's one reason not to use it), that's about the
>> only significant problem with the *syntax*.
>
> Here is the reason I worry. The harder things are to do, the more likely
> mistakes will be made. That is why I prefer simpler formats.

Formats or syntaxes?  Let's be clear.

And yes, the fact that ASN.1 is relatively difficult to parse (but not
that difficult) has been used as an excuse to not use it or not write
tooling for it and just hand-code BER/DER coders.  But I think in
retrospect that it's not really the cause of the problem.  More likely
the fact that it was a non-free standard for so long meant that many
people coded to it without a proper understanding if it, much less
access to tools for it.  But that's ancient history now.  What about
the present?  Why not use this or that not-ad-hoc syntax?

> While I'm bashing ASN.1, formats that allow infinite length data items are
> asking for buffer overruns.

Like JSON?  Parsers/decoders need to impose some reasonable limits.
But this is not where the buffer overflows come from.  The buffer
overflows I think you're thinking of mostly resulted from redundancy
in TLV encodings.

Nico
--