Re: [Json] Nested JSON encoding style too likely to be insecure

"Manger, James" <James.H.Manger@team.telstra.com> Tue, 23 February 2016 06:08 UTC

Return-Path: <James.H.Manger@team.telstra.com>
X-Original-To: json@ietfa.amsl.com
Delivered-To: json@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id AEDC41B2A20 for <json@ietfa.amsl.com>; Mon, 22 Feb 2016 22:08:46 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: 0.997
X-Spam-Level:
X-Spam-Status: No, score=0.997 tagged_above=-999 required=5 tests=[BAYES_20=-0.001, HELO_EQ_AU=0.377, HOST_EQ_AU=0.327, RCVD_IN_DNSWL_LOW=-0.7, RELAY_IS_203=0.994] autolearn=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 EgV4maoFNxnw for <json@ietfa.amsl.com>; Mon, 22 Feb 2016 22:08:45 -0800 (PST)
Received: from ipxbno.tcif.telstra.com.au (ipxbno.tcif.telstra.com.au [203.35.82.204]) by ietfa.amsl.com (Postfix) with ESMTP id 6CFB71B2A1B for <json@ietf.org>; Mon, 22 Feb 2016 22:08:45 -0800 (PST)
X-IronPort-AV: E=Sophos;i="5.22,488,1449493200"; d="scan'208";a="60302853"
Received: from unknown (HELO ipcbni.tcif.telstra.com.au) ([10.97.216.204]) by ipobni.tcif.telstra.com.au with ESMTP; 23 Feb 2016 17:08:43 +1100
X-IronPort-AV: E=McAfee;i="5700,7163,8083"; a="84100463"
Received: from wsmsg3753.srv.dir.telstra.com ([172.49.40.174]) by ipcbni.tcif.telstra.com.au with ESMTP; 23 Feb 2016 17:08:43 +1100
Received: from WSMSG3153V.srv.dir.telstra.com ([172.49.40.159]) by WSMSG3753.srv.dir.telstra.com ([fe80::4455:9840:ced2:23fa%12]) with mapi; Tue, 23 Feb 2016 17:08:43 +1100
From: "Manger, James" <James.H.Manger@team.telstra.com>
To: Phillip Hallam-Baker <ietf@hallambaker.com>
Date: Tue, 23 Feb 2016 17:08:30 +1100
Thread-Topic: [Json] Nested JSON encoding style too likely to be insecure
Thread-Index: AdFt/qSDFXT8xwuCTxCV5XOL6E30uwAAEvOw
Message-ID: <255B9BB34FB7D647A506DC292726F6E13BBADBF6C2@WSMSG3153V.srv.dir.telstra.com>
References: <255B9BB34FB7D647A506DC292726F6E13BBADBF674@WSMSG3153V.srv.dir.telstra.com> <CAMm+LwjwWEmJqcicdwZ+fE3+XMamoDF8RfCMLRz75MpFB=tiWg@mail.gmail.com>
In-Reply-To: <CAMm+LwjwWEmJqcicdwZ+fE3+XMamoDF8RfCMLRz75MpFB=tiWg@mail.gmail.com>
Accept-Language: en-US, en-AU
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
acceptlanguage: en-US, en-AU
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
MIME-Version: 1.0
Archived-At: <http://mailarchive.ietf.org/arch/msg/json/WWX2c03c2-5ngu5JG6Cn6clDm5E>
Cc: "json@ietf.org" <json@ietf.org>
Subject: Re: [Json] Nested JSON encoding style too likely to be insecure
X-BeenThere: json@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: "JavaScript Object Notation \(JSON\) WG mailing list" <json.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/json>, <mailto:json-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/json/>
List-Post: <mailto:json@ietf.org>
List-Help: <mailto:json-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/json>, <mailto:json-request@ietf.org?subject=subscribe>
X-List-Received-Date: Tue, 23 Feb 2016 06:08:46 -0000

> You need to limit the toplevel to one element. That is fairly easy to do though.

Easy to do; but even easier not to do. Does your code already do this?
This is not the sort of check I want to rely on developers making. It is not obvious that the check is needed; certainly not from looking at a few sample messages.

Checking there is only 1 top-level element can't be done until you get to the end of the first element’s value — which seems to clash with your rationale for the nested style.

A JSON array still looks better.

--
James Manger