Re: JSON headers

Julian Reschke <julian.reschke@gmx.de> Tue, 12 July 2016 06:56 UTC

Return-Path: <ietf-http-wg-request+bounce-httpbisa-archive-bis2juki=lists.ie@listhub.w3.org>
X-Original-To: ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com
Delivered-To: ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id B6DD212D0E7 for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Mon, 11 Jul 2016 23:56:45 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -8.208
X-Spam-Level:
X-Spam-Status: No, score=-8.208 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.001, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-1.287, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=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 Qu4Y8LLOxO1f for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Mon, 11 Jul 2016 23:56:44 -0700 (PDT)
Received: from frink.w3.org (frink.w3.org [128.30.52.56]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 9046812D0B7 for <httpbisa-archive-bis2Juki@lists.ietf.org>; Mon, 11 Jul 2016 23:56:44 -0700 (PDT)
Received: from lists by frink.w3.org with local (Exim 4.80) (envelope-from <ietf-http-wg-request@listhub.w3.org>) id 1bMrYI-0005ub-JN for ietf-http-wg-dist@listhub.w3.org; Tue, 12 Jul 2016 06:52:18 +0000
Resent-Date: Tue, 12 Jul 2016 06:52:18 +0000
Resent-Message-Id: <E1bMrYI-0005ub-JN@frink.w3.org>
Received: from lisa.w3.org ([128.30.52.41]) by frink.w3.org with esmtps (TLS1.2:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from <julian.reschke@gmx.de>) id 1bMrYE-0005tl-JM for ietf-http-wg@listhub.w3.org; Tue, 12 Jul 2016 06:52:14 +0000
Received: from mout.gmx.net ([212.227.15.15]) by lisa.w3.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from <julian.reschke@gmx.de>) id 1bMrY9-0006jD-2R for ietf-http-wg@w3.org; Tue, 12 Jul 2016 06:52:12 +0000
Received: from [192.168.178.20] ([93.217.93.203]) by mail.gmx.com (mrgmx002) with ESMTPSA (Nemesis) id 0MMBun-1bSdDl0sLl-00840n; Tue, 12 Jul 2016 08:51:08 +0200
To: Carsten Bormann <cabo@tzi.org>
References: <8251.1468229350@critter.freebsd.dk> <e9a55629-656c-3b6a-3ac4-5fb7a109b2f0@gmx.de> <8739.1468234635@critter.freebsd.dk> <38b3e7bb-3202-f489-ff15-d4d545e13ca0@gmx.de> <8854.1468236033@critter.freebsd.dk> <326f0b93-dbd5-3dfb-2a35-d1bf084684b4@gmx.de> <9221.1468245597@critter.freebsd.dk> <aa9cee9c-d8e3-17ba-9fcd-e327575cd5a8@gmx.de> <9801.1468259070@critter.freebsd.dk> <15d27f23-6b51-1e8e-3f10-194c80570424@gmx.de> <20160711190107.GB9542@1wt.eu> <0e467573-4f68-80a5-14a4-5a63b41ac4d4@gmx.de> <57841F4A.30901@tzi.org> <57e2c1b6-749f-c697-5c92-15eeb44b303b@gmx.de> <57849130.4060104@tzi.org>
Cc: Willy Tarreau <w@1wt.eu>, Poul-Henning Kamp <phk@phk.freebsd.dk>, Yanick Rochon <yanick.rochon@gmail.com>, Phil Hunt <phil.hunt@oracle.com>, HTTP Working Group <ietf-http-wg@w3.org>
From: Julian Reschke <julian.reschke@gmx.de>
Message-ID: <928f8531-6573-caf6-50c1-1672cc020959@gmx.de>
Date: Tue, 12 Jul 2016 08:51:07 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0
MIME-Version: 1.0
In-Reply-To: <57849130.4060104@tzi.org>
Content-Type: text/plain; charset="utf-8"; format="flowed"
Content-Transfer-Encoding: 7bit
X-Provags-ID: V03:K0:bVS2sd63FAMJUmRefQHESrkJnWx7Qd8cdsqwFFyBkI7H5BBNeUt vUCw5h4s/r/Kl9RmEUNsdutLW9FteOCZAeWyzBzbkhyD0bMJ0dRRCOSLI0fHBMkPWxJhg10 JShW3KVx9wOJ6/Ah1Vo9CqDnMgs+zUXblxtQKty8uGn1Lf7ZjOFjOpyBKQxtWtOYt6rEOx7 ex3GZtPMM6GOw45Bb3+OQ==
X-UI-Out-Filterresults: notjunk:1;V01:K0:FJj7mUpMbfw=:wN26PtScdpMYNlix/sBsQv t42r11RO09dzNYmjl2D6ngJcdgbXc66SK9ae7MiByFJagZrDzUk8yWbUUfnfWZOvZOSCEr5ua Qbbs/bO4j9sSzcHi4trq9kq5buokivVhIUokoq1oUOXo4svsB0xdCAhKqdLtlSb+T8JJwrcsQ MlIW/PVyby75E1fsh/9ZgA5zJHqa6Wv1cIiPKvB528GW5v/F1IScqiPxHn3yLYC3EQIPpGI6J 9u0z5usniXmq/n4iqsaJyv8lwas0gC2/Mk/ey4szwSeJXZJVpoO7whK7rJzlAZLbx4Hvz2d/m PmfTNRTBqMwaDzM9hcoXGGgskibwjb25LmZPknn6SALlwQpOxavu6eSHah1Xro7G40oP6jIf5 JDz9Yibk2vciYcFtSRGdRmlvAsTdIRxMuTPNojxKAJ9i+T8kulNITjfrg8jcDs4xEQDGthS2x 5Pf1nBM1JX2SZu5tqzV5P9/qPlMBojtJEZmvlznCqo206r8jzT57GVizTT93Cq7tpMaV3EVsl oz4WQcTCZzYyg5OdfAGVR8pJiibrfoFDsbBf01hkwWu6gHqvPJL8kWM/MqPqKkPJWvD/FFleB jHWAw077L+pu/R00q7wFJJ/fQTi0RaKRvT3sRJHYH2u5gN37pVSb0ZKU2d1UyUUv/1N43z18/ 4BIRGaOrptN3hmb/rJgvz55ZyYbJ3K7APr/PXtD+1uwRLTGkJ4RC9dc9aMN2riT9RqsSdGw5Y L37IyM3Sqjo3vv+aG0NhfwsNzTa+wHbri5kWUCWXKKgR9sxVNbsX8SAYsrtKqgC4nBlPwaoko 5kD6NV8
Received-SPF: pass client-ip=212.227.15.15; envelope-from=julian.reschke@gmx.de; helo=mout.gmx.net
X-W3C-Hub-Spam-Status: No, score=-6.7
X-W3C-Hub-Spam-Report: AWL=-0.078, BAYES_00=-1.9, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_PASS=-0.001, W3C_AA=-1, W3C_DB=-1, W3C_IRA=-1, W3C_WL=-1
X-W3C-Scan-Sig: lisa.w3.org 1bMrY9-0006jD-2R fbc287b049af2c9333e0522d175f6fbd
X-Original-To: ietf-http-wg@w3.org
Subject: Re: JSON headers
Archived-At: <http://www.w3.org/mid/928f8531-6573-caf6-50c1-1672cc020959@gmx.de>
Resent-From: ietf-http-wg@w3.org
X-Mailing-List: <ietf-http-wg@w3.org> archive/latest/31917
X-Loop: ietf-http-wg@w3.org
Resent-Sender: ietf-http-wg-request@w3.org
Precedence: list
List-Id: <ietf-http-wg.w3.org>
List-Help: <http://www.w3.org/Mail/>
List-Post: <mailto:ietf-http-wg@w3.org>
List-Unsubscribe: <mailto:ietf-http-wg-request@w3.org?subject=unsubscribe>

On 2016-07-12 08:41, Carsten Bormann wrote:
>> It is allowed by the structure of the *wire format*.
>
> The syntax indeed cannot prevent it.
> It's still not *allowed* in JSON.
>
>> The *specification* has a "SHOULD have unique names", but then, that's
>> only a SHOULD (exactly because we know we can't rely on it, otherwise we
>> wouldn't have the prose about what recipients can do with it).
>
> It is a SHOULD because people were chickening out because of a possible
> political conflict with ECMA 404.  Note well that no reason is given to
> ever violate that SHOULD.

But we do know why it's violated in practice:

1) Streaming might make it hard to check for senders,

2) People abusing it to add comments to JSON (by choosing a member name 
for comments, and repeating it).

...and probably for other reasons I'm not aware of.

> Now, for performance reasons, there is no requirement on a receiver to
> check for this constraint.  Protocol design 101 tells us that a lack of
> checking will cause implementations to emit invalid JSON just because
> they can (the "soup" effect).  Hence the description in RFC 7159 what
> goes wrong when you do that.  (However, the security considerations fail
> to mention the check-vs-use vulnerabilities that inevitably come from
> the variety in implementation strategies; the last paragraph of Section
> 8 of RFC 7049 does apply.)

Maybe something for JSONbis?

> This discussion may be a bit off-topic for the HTTP WG, but I think it
> is important to understand JSON when using it in HTTP.

Absolutely; and the conclusion might well be that we won't use JSON on 
the wire.

Best regards, Julian