Re: [apps-discuss] Concise Binary Object Representation (CBOR)

Tony Finch <dot@dotat.at> Thu, 23 May 2013 17:26 UTC

Return-Path: <fanf2@hermes.cam.ac.uk>
X-Original-To: apps-discuss@ietfa.amsl.com
Delivered-To: apps-discuss@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 172A221F92FB for <apps-discuss@ietfa.amsl.com>; Thu, 23 May 2013 10:26:43 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.599
X-Spam-Level:
X-Spam-Status: No, score=-2.599 tagged_above=-999 required=5 tests=[BAYES_00=-2.599]
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 ymFGx8kxuTs4 for <apps-discuss@ietfa.amsl.com>; Thu, 23 May 2013 10:26:32 -0700 (PDT)
Received: from ppsw-32.csi.cam.ac.uk (ppsw-32.csi.cam.ac.uk [IPv6:2001:630:212:8::e:f32]) by ietfa.amsl.com (Postfix) with ESMTP id D600721F93B1 for <apps-discuss@ietf.org>; Thu, 23 May 2013 10:16:37 -0700 (PDT)
X-Cam-AntiVirus: no malware found
X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/
Received: from hermes-2.csi.cam.ac.uk ([131.111.8.54]:41094) by ppsw-32.csi.cam.ac.uk (smtp.hermes.cam.ac.uk [131.111.8.156]:25) with esmtpa (EXTERNAL:fanf2) id 1UfZ7x-0006ta-2M (Exim 4.80_167-5a66dd3) (return-path <fanf2@hermes.cam.ac.uk>); Thu, 23 May 2013 18:16:33 +0100
Received: from fanf2 by hermes-2.csi.cam.ac.uk (hermes.cam.ac.uk) with local id 1UfZ7x-0004P9-M8 (Exim 4.72) (return-path <fanf2@hermes.cam.ac.uk>); Thu, 23 May 2013 18:16:33 +0100
Date: Thu, 23 May 2013 18:16:33 +0100
From: Tony Finch <dot@dotat.at>
X-X-Sender: fanf2@hermes-2.csi.cam.ac.uk
To: Carsten Bormann <cabo@tzi.org>
In-Reply-To: <84317001-DB56-4DBE-9D1E-A4E605BC07A0@tzi.org>
Message-ID: <alpine.LSU.2.00.1305231811430.30305@hermes-2.csi.cam.ac.uk>
References: <61CB1D18-BABC-4C77-93E6-A9E8CDA8326B@vpnc.org> <CAK3OfOhVRqUp+xn8mBj8_x8pgubc7bhWebzsFLvoj+ieWmr5gg@mail.gmail.com> <142483A4-2E80-43F1-B3BE-B5B01650BB8F@tzi.org> <CAK3OfOim44hRaRoFh8vKfK5SPVAnvTGiBV4cizvw30K=ZQPJHQ@mail.gmail.com> <84317001-DB56-4DBE-9D1E-A4E605BC07A0@tzi.org>
User-Agent: Alpine 2.00 (LSU 1167 2008-08-23)
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset="US-ASCII"
Sender: Tony Finch <fanf2@hermes.cam.ac.uk>
Cc: Paul Hoffman <paul.hoffman@vpnc.org>, apps-discuss@ietf.org
Subject: Re: [apps-discuss] Concise Binary Object Representation (CBOR)
X-BeenThere: apps-discuss@ietf.org
X-Mailman-Version: 2.1.12
Precedence: list
List-Id: General discussion of application-layer protocols <apps-discuss.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/apps-discuss>, <mailto:apps-discuss-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/apps-discuss>
List-Post: <mailto:apps-discuss@ietf.org>
List-Help: <mailto:apps-discuss-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/apps-discuss>, <mailto:apps-discuss-request@ietf.org?subject=subscribe>
X-List-Received-Date: Thu, 23 May 2013 17:26:43 -0000

Carsten Bormann <cabo@tzi.org> wrote:
> On May 23, 2013, at 17:35, Nico Williams <nico@cryptonector.com> wrote:
>
> > Many a ECMAScript and/or JSON implementation use NaN coding, which is
> > probably why this restriction is there in the first place (though
> > that's just a guess; I'm sure there's a list archive somewhere with a
> > lengthy discussion I could check; I don't care).
>
> Now you lost me -- JSON doesn't have NaNs.
> (Another thing that CBOR has that you can't use in a JSON subset.)

It is probably worth putting something in the security considerations
about NaNs. See for instance
http://article.gmane.org/gmane.comp.lang.lua.general/70705
and http://trac.webkit.org/changeset/64706

Also, the multiple forms of encoding for integers mean that applications
have to be careful how they handle range and equality checks - there's an
analogous problem to the loose UTF-8 parser security bugs.

Tony.
-- 
f.anthony.n.finch  <dot@dotat.at>  http://dotat.at/
Forties, Cromarty: East, veering southeast, 4 or 5, occasionally 6 at first.
Rough, becoming slight or moderate. Showers, rain at first. Moderate or good,
occasionally poor at first.