[Json] Bug in RFC7493 (I-JSON)?

Anders Rundgren <anders.rundgren.net@gmail.com> Sun, 06 May 2018 06:21 UTC

Return-Path: <anders.rundgren.net@gmail.com>
X-Original-To: json@ietfa.amsl.com
Delivered-To: json@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id C098A126C25 for <json@ietfa.amsl.com>; Sat, 5 May 2018 23:21:08 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2
X-Spam-Level:
X-Spam-Status: No, score=-2 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] 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 FlET2ywujnIL for <json@ietfa.amsl.com>; Sat, 5 May 2018 23:21:07 -0700 (PDT)
Received: from mail-wr0-x233.google.com (mail-wr0-x233.google.com [IPv6:2a00:1450:400c:c0c::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 A3846126B6D for <json@ietf.org>; Sat, 5 May 2018 23:21:06 -0700 (PDT)
Received: by mail-wr0-x233.google.com with SMTP id g21-v6so24743157wrb.8 for <json@ietf.org>; Sat, 05 May 2018 23:21:06 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:subject:to:message-id:date:user-agent:mime-version :content-transfer-encoding:content-language; bh=p/hMqf8ZguY+kgZWqi9Fz4QsbEmiUFQVeqm1ycEV4oM=; b=mItd4SExma2LSN0zyCwRonXpD6JNbJtq/HjXfNtEx0GAUdl1jFwKfy8q+iqexZBg30 Vqw9Z1urRzdysZkzdnQbYudtOXixp+bNQyS8gWXw3H6+VeM8AMmRu7GtzAxlhoYBXLAZ JDdyzM9CbE1s0kk1+wG2JMcpbgyLnHxNdifuGKNAWZUp7/3gBtvjBBsSO9nA3Mg+X9/b oheM6PCB6qM3duuAVDURs31KuKKdtbroYzrdYKeV8Vj2tQp7zF2X2PS6R4EmR3yPoyKx 2VmTCLnNXCpvznAdkIWlLUCBPSnwLLwQBqiNyjw0f9GJtt0oRbe+jxB6D0ilUzkt/dlT Uz7Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:subject:to:message-id:date:user-agent :mime-version:content-transfer-encoding:content-language; bh=p/hMqf8ZguY+kgZWqi9Fz4QsbEmiUFQVeqm1ycEV4oM=; b=meGp12kBRju9Izq5KUW6qPmu3KaKglRTySuPDoTtDoYVy9dpkqYh9Qy1hipL2sqobk PPbxQ4TRQzscca2Aw+LbSFjh/uVbzV0qvsphUqQOih3Tk2wXR3kuMrpKUbJQ0jZrwbVj q0QDYc7e/cYmzuNXIF7Qu6H9+TlvdJsAfZB/0s2Z3NIi3u/oIwMoVH17tkxrPpOenYT+ FFIfRV7BcXRduLVIZ2MLuFFTr2asdyyMS/SvIWA58kU3J2JYZtmGZbdc6tgVAS2Mciej lntBc3RyS1s8kqgW9gO77T6kh1OjAHqnttB11rF6/m9N4yuK20WQ7hzCkrQGf93TIrOZ Kt4w==
X-Gm-Message-State: ALQs6tBWya5Fxf2VqeZqwwAdbs5UVAbfiOLcdfnkNnHhoyVM/uJngft9 HqrKJQMD/izNx17fisecHe13YQ==
X-Google-Smtp-Source: AB8JxZr6gfeKH6yc2NjZzmUhomXCKUhwwacBX1wOxNg99yyf1LObJKmW5qG66khuTu17FHlj51BR9Q==
X-Received: by 2002:adf:bbce:: with SMTP id z14-v6mr27016458wrg.183.1525587664795; Sat, 05 May 2018 23:21:04 -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 u20-v6sm29924531wru.33.2018.05.05.23.21.03 for <json@ietf.org> (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 05 May 2018 23:21:04 -0700 (PDT)
From: Anders Rundgren <anders.rundgren.net@gmail.com>
To: "json@ietf.org" <json@ietf.org>
Message-ID: <d9235420-09e2-4d25-1e4d-19848e2c48d8@gmail.com>
Date: Sun, 06 May 2018 08:21:00 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"; format="flowed"
Content-Transfer-Encoding: 7bit
Content-Language: en-US
Archived-At: <https://mailarchive.ietf.org/arch/msg/json/bQYchpP5PeTSJDM11iE2z6mQP04>
Subject: [Json] Bug in RFC7493 (I-JSON)?
X-BeenThere: json@ietf.org
X-Mailman-Version: 2.1.22
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: Sun, 06 May 2018 06:21:09 -0000

During testing of the JSON canonicalizer [1,2] I tried with an integer just above the specified limit (2**53) + 1 and to my surprise it didn't fail.
A short run with an IEEE-754/ES6 debugger seemed to confirm that +-2**53 is the actual limit for integers.

Input floating point: 9007199254740991
Output floating point: 9007199254740991
Hex value: 433fffffffffffff
Binary value: 0 10000110011 1111111111111111111111111111111111111111111111111111

Input floating point: 9007199254740992
Output floating point: 9007199254740992
Hex value: 4340000000000000
Binary value: 0 10000110100 0000000000000000000000000000000000000000000000000000

Anders

1] https://github.com/cyberphone/json-canonicalization#json-canonicalization
2] https://cyberphone.github.io/doc/security/draft-rundgren-json-canonicalization-scheme.html