Re: [apps-discuss] Review of draft-ietf-appsawg-json-pointer

Mark Nottingham <mnot@mnot.net> Fri, 16 November 2012 06:12 UTC

Return-Path: <mnot@mnot.net>
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 0CA1321F888D for <apps-discuss@ietfa.amsl.com>; Thu, 15 Nov 2012 22:12:30 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -104.67
X-Spam-Level:
X-Spam-Status: No, score=-104.67 tagged_above=-999 required=5 tests=[AWL=-2.071, BAYES_00=-2.599, USER_IN_WHITELIST=-100]
Received: from mail.ietf.org ([64.170.98.30]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id fdArf0CjrhOV for <apps-discuss@ietfa.amsl.com>; Thu, 15 Nov 2012 22:12:29 -0800 (PST)
Received: from mxout-08.mxes.net (mxout-08.mxes.net [216.86.168.183]) by ietfa.amsl.com (Postfix) with ESMTP id 59CA021F8891 for <apps-discuss@ietf.org>; Thu, 15 Nov 2012 22:12:17 -0800 (PST)
Received: from [192.168.1.64] (unknown [118.209.81.233]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by smtp.mxes.net (Postfix) with ESMTPSA id 02F6C509B5; Fri, 16 Nov 2012 01:12:14 -0500 (EST)
Content-Type: text/plain; charset="windows-1252"
Mime-Version: 1.0 (Mac OS X Mail 6.2 \(1499\))
From: Mark Nottingham <mnot@mnot.net>
In-Reply-To: <255B9BB34FB7D647A506DC292726F6E115006C7BCF@WSMSG3153V.srv.dir.telstra.com>
Date: Fri, 16 Nov 2012 17:12:13 +1100
Content-Transfer-Encoding: quoted-printable
Message-Id: <BA835268-D071-4694-9B61-61DB6CE6C006@mnot.net>
References: <D8B6B887-7206-4197-B78D-7E2B38A20EF9@vpnc.org> <255B9BB34FB7D647A506DC292726F6E115006C7A5C@WSMSG3153V.srv.dir.telstra.com> <45B7BA35-8717-4597-902B-168E7B894A68@mnot.net> <255B9BB34FB7D647A506DC292726F6E115006C7BCF@WSMSG3153V.srv.dir.telstra.com>
To: "Manger, James H" <James.H.Manger@team.telstra.com>
X-Mailer: Apple Mail (2.1499)
Cc: Paul Hoffman <paul.hoffman@vpnc.org>, "apps-discuss@ietf.org Discuss" <apps-discuss@ietf.org>
Subject: Re: [apps-discuss] Review of draft-ietf-appsawg-json-pointer
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: Fri, 16 Nov 2012 06:12:30 -0000

In SVN.

On 16/11/2012, at 3:50 PM, "Manger, James H" <James.H.Manger@team.telstra.com> wrote:

>>> The issue with NUL is that you need to be careful not to misinterpret
>> it as an end-of-string marker. How about:
>>> 
>>>  Note that JSON pointers can contain the NUL (Unicode U+0000)
>>>  character. Care is needed not to misinterpret this character
>>>  in programming languages that use NUL to mark the end of a string.
> 
>> In Security Considerations?
> 
> Yes. Treating NUL as end-of-string is more of a security issue than not being able represent some characters.
> 
> Bad guys stuck NULs in domain name fields in certificates (eg paypal.com<NUL>www.badguy.net). One party treats it as a (harmless) subdomain of badguy.net; another party is fooled into believing it is for paypal.com. Result: security failure.
> 
> Consider the pointer "/readonly\u0000abc" in a patch {"op":"remove", "path":"/readonly\u0000abc"} applied to a doc {"readonly":"MUST NOT BE TOUCHED", "anyone":"can change anything else"}. A security layer that properly handles NUL will allow the patch through; but a subsequent processor that isn't careful about NUL might treat the pointer as "/readonly" and disaster results.
> 
> 
> About the only other security consideration I can think of is checking that an array index does not overflow a programs representation (eg don’t treat "/4294967297" as "/1", throw an error if necessary).
> 
> --
> James Manger

--
Mark Nottingham   http://www.mnot.net/