Re: [dispatch] PING2. Re: JSON Canonicalization Standard

Anders Rundgren <anders.rundgren.net@gmail.com> Sat, 08 September 2018 08:13 UTC

Return-Path: <anders.rundgren.net@gmail.com>
X-Original-To: dispatch@ietfa.amsl.com
Delivered-To: dispatch@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 3412C129C6A for <dispatch@ietfa.amsl.com>; Sat, 8 Sep 2018 01:13:32 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.999
X-Spam-Level:
X-Spam-Status: No, score=-1.999 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com
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 qYaYNGcQEG7e for <dispatch@ietfa.amsl.com>; Sat, 8 Sep 2018 01:13:30 -0700 (PDT)
Received: from mail-wm0-x233.google.com (mail-wm0-x233.google.com [IPv6:2a00:1450:400c:c09::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 2961C126BED for <dispatch@ietf.org>; Sat, 8 Sep 2018 01:13:30 -0700 (PDT)
Received: by mail-wm0-x233.google.com with SMTP id s12-v6so16745717wmc.0 for <dispatch@ietf.org>; Sat, 08 Sep 2018 01:13:30 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=F97il8h9OFUFYkyTOfRgW3Qbb803LenRM34DkuwiuCg=; b=KJpwfdHtN7hmQg4ZBDKCywv5gDHUg8uAXTi0Gvns9wzd4y4O004dhbNyUXcyfpbSOm TxzzzerAqqqCX2WCTaQzcV5PlHHOry+OR6O8e1NzGU9LqQurmCxKW7OLOOahj8hp0av/ DFBG8uDEYSrQfKTe+UEcF7Huzm22iFwehehHe2/Chg0Hume9Vwlkb2uIxMCSHT7qSnDc 2Sw0QE6+aeEv8w5VJ5BnFLIMOP1DCM+2eTBmy+vmbhefn2ydIJP8zli/Ggs0y40FC5ur TdK/0OLLVPkfZTMQADV+s+wlwmdKtoC5rimfp/t+0zdRgkiJTUK/s+LnP4Ad4Co8F8Kk uQFA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=F97il8h9OFUFYkyTOfRgW3Qbb803LenRM34DkuwiuCg=; b=WGfHGngqNNfGlueDsdsdJqrxJrVKwcUGzpVulhSquoiptyWJpX6NhIKdYm1IG7qXtA WkJTLZDgVAoBQ9tKQGRZYL4wGuY4w1t22QWSat6Vp+NYReTIWNWbxs/01vorKVgQqGcI Jdx+5r1v6pY40XhklWbe1UpO/wrvBD7HUIUyCGuFtGaj/x/ERC5FpyKKLXuPS+cVZp1F YgH48cCezOSKn8MzTmzla2zoF7Li7co8Ch8NWdUjLlqzh9/h9NtoyAX0LfBedNelLmr7 +o48oS4N12CbxNPtwCiolgydzqD1G9MuBqeKrYUjojaZ70s27U6IsF2ePJ/dN0wSxcGw bHfA==
X-Gm-Message-State: APzg51BxyHTjhrxyby73CxS7Pvelp0x2BWvjARExqk784NvFE2+uAB09 klCOyIB04sfO/WktrkLrqt4=
X-Google-Smtp-Source: ANB0VdZ7DaA5tc/7lJbpjJnuavSDN8p4AUYr4COZAWaDelSLNHyN/2jkw7rRczOqdjT8JUC1+3o87w==
X-Received: by 2002:a1c:be14:: with SMTP id o20-v6mr7554073wmf.73.1536394408616; Sat, 08 Sep 2018 01:13:28 -0700 (PDT)
Received: from [192.168.1.79] (25.131.146.77.rev.sfr.net. [77.146.131.25]) by smtp.googlemail.com with ESMTPSA id l10-v6sm8151371wre.0.2018.09.08.01.13.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 08 Sep 2018 01:13:27 -0700 (PDT)
To: Brian Campbell <bcampbell@pingidentity.com>, dispatch@ietf.org
Cc: Eric Rescorla <ekr@rtfm.com>, Ben Campbell <ben@nostrum.com>
References: <CA+k3eCRvc5a-=5dR7xrOjaPtMM5JCqJ5DUPTZMVHjo3VtR2EOw@mail.gmail.com>
From: Anders Rundgren <anders.rundgren.net@gmail.com>
Message-ID: <08f97b7e-12d1-cd18-64e6-3b02a733bce0@gmail.com>
Date: Sat, 08 Sep 2018 10:13:24 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1
MIME-Version: 1.0
In-Reply-To: <CA+k3eCRvc5a-=5dR7xrOjaPtMM5JCqJ5DUPTZMVHjo3VtR2EOw@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"; format="flowed"
Content-Language: en-US
Content-Transfer-Encoding: 7bit
Archived-At: <https://mailarchive.ietf.org/arch/msg/dispatch/z-EYqtrO7d6t6To43BTcrpyBVNg>
Subject: Re: [dispatch] PING2. Re: JSON Canonicalization Standard
X-BeenThere: dispatch@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: DISPATCH Working Group Mail List <dispatch.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/dispatch>, <mailto:dispatch-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/dispatch/>
List-Post: <mailto:dispatch@ietf.org>
List-Help: <mailto:dispatch-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/dispatch>, <mailto:dispatch-request@ietf.org?subject=subscribe>
X-List-Received-Date: Sat, 08 Sep 2018 08:13:32 -0000

On 2018-09-07 22:40, Brian Campbell wrote:
> XML Canonicalization and Signatures are notoriously brittle and difficult to 
> get right while also being the source of numerous serious security vulnerabilities.
> The JSON case is maybe simpler and thus somewhat less prone to the same issues but, 
> if history is any guide, it's really hard to get right and is fertile ground for all kinds of attacks.

This I've been told numerous of times.  I'm still waiting for a concrete example [*] of what could possibly be a problem.

Having worked pretty extensively with both variants I can attest that there is at least a factor 10 difference in code size due to the absence of schema, name-spaces and defaults.  I believe the quite complex WS security frameworks also were a source of interoperability issues with XML.

The only thing that (undeniable) is non-trivial is serialization of the JSON Number type.  Fortunately, the scheme defined by EMCAScript and supported by several open source implementations made even this part simple.  I performed a fully verified port to C# in just a couple of days.

FWIW, a "companion I-D" was recently published: https://tools.ietf.org/html/draft-erdtman-jose-cleartext-jws-01

Anders

*] https://cyberphone.github.io/doc/security/jwsvariants.pdf