Re: [jose] JWS signature verification and claims payload

Les Hazlewood <lhazlewood@gmail.com> Fri, 13 October 2023 00:09 UTC

Return-Path: <lhazlewood@gmail.com>
X-Original-To: jose@ietfa.amsl.com
Delivered-To: jose@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 69570C139C65 for <jose@ietfa.amsl.com>; Thu, 12 Oct 2023 17:09:51 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.107
X-Spam-Level:
X-Spam-Status: No, score=-2.107 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01] 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 ([50.223.129.194]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id tTvIDD8eQKpb for <jose@ietfa.amsl.com>; Thu, 12 Oct 2023 17:09:46 -0700 (PDT)
Received: from mail-yw1-x1130.google.com (mail-yw1-x1130.google.com [IPv6:2607:f8b0:4864:20::1130]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id EA4E0C14CEFF for <jose@ietf.org>; Thu, 12 Oct 2023 17:09:46 -0700 (PDT)
Received: by mail-yw1-x1130.google.com with SMTP id 00721157ae682-5a7d9d357faso20163387b3.0 for <jose@ietf.org>; Thu, 12 Oct 2023 17:09:46 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1697155786; x=1697760586; darn=ietf.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=QpffhiKKpOblFaLv6tBNFHwu8zA4YI98+naD1Ozwhdo=; b=j2vCvW/jbi1WRlvrQ9D84w9TpT2Z0wuwW7pkFJHV5+MIZ+pCIOY0uI9wcpB3JqVx+i /yTO5/z5kugRy2G/8KGf5Hf/BilmB1enqWVNw5Cw3c8jUg4QrZhED/mgd0QMf3SUSMFI jUhGJbvxLLmoPk8NdasfgcH1dIoH/yynBI1BPtpXQXvVrGzhlFPOBQZ4eE2SkRgAYaRh Yz9sz4ke8XD6Bt7zLEaGSqfFLrCbtacU9kJ4/oA4IiS1nbJaarSWT7gNdTODn4LcSOtb 5+nfShPM2qzOJJ76svwITfeoTSmkMhbfPidEyBEBZ1lTnACeAdNsxngV/Njgen1+sZGi SbZA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697155786; x=1697760586; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=QpffhiKKpOblFaLv6tBNFHwu8zA4YI98+naD1Ozwhdo=; b=ZeqSGOQF1rrVG4ZEP5VfEa4Hl/my3ZdhuuvBofnQ5TwUmkUfGWIbQfQpNL+dz7Eelg XcTMZtgI9NmiXVesZVpKo551z8WpZoaVxDzN/RteT3h+ryG9+IrJGjxcsnguofQcvONi 4CRaq7yvXla/JPhXhm2HO00vF0zm2JpYTm3iCJWMwfadpOVK5+ZCiXZ9nAn5GUGKYdCk oWYL1vMNEJAnHKU+Qk+4bTvgTUgPLPX/sZZ+vBKKwX04Y/lLDVLlPdFXG3Pncrszt804 QmfKg4PFj6GmSrH+CskStJKO2qPzLWumJvmzp31EjBvtnQwxoX7ljNir/6qIhduKVz4b g1Fw==
X-Gm-Message-State: AOJu0YwDTHg31YioSmU3sVOVE+xInxJSz8UThWTVzakAJOTuMpQUqMZE hUsB4PT7tlLxDxYACa3JcwSyzSkJrrVYLO+lN07uBvkdeW0opg==
X-Google-Smtp-Source: AGHT+IFXKLiwYhuFDVNAC9Hz8W0xgOGypyvqQs3v1b3Ox9mjb11yMqq/WY6wBbjD552U+6ZF/Gy1lCxYY+d8VHVht4s=
X-Received: by 2002:a81:5cd6:0:b0:59c:aea:d877 with SMTP id q205-20020a815cd6000000b0059c0aead877mr28359266ywb.40.1697155786039; Thu, 12 Oct 2023 17:09:46 -0700 (PDT)
MIME-Version: 1.0
References: <CACVbtYO28BkxPXoXKUojjV_XFGQOEV7EDs=d1TZ9ymcBhFicUQ@mail.gmail.com> <SYBPR01MB5981D07B6A2F4D92C709B74BE5D3A@SYBPR01MB5981.ausprd01.prod.outlook.com>
In-Reply-To: <SYBPR01MB5981D07B6A2F4D92C709B74BE5D3A@SYBPR01MB5981.ausprd01.prod.outlook.com>
From: Les Hazlewood <lhazlewood@gmail.com>
Date: Thu, 12 Oct 2023 17:09:34 -0700
Message-ID: <CACVbtYMwheJF0MCs53ZGbTbO_nLMVG4HUdFRA2c3NWi7x4wHXw@mail.gmail.com>
To: "Manger, James" <James.H.Manger@team.telstra.com>
Cc: "jose@ietf.org" <jose@ietf.org>
Content-Type: multipart/alternative; boundary="000000000000c1684d06078ddfaf"
Archived-At: <https://mailarchive.ietf.org/arch/msg/jose/3e80sReluoS2jOFMfKPgOqm_n5k>
Subject: Re: [jose] JWS signature verification and claims payload
X-BeenThere: jose@ietf.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: Javascript Object Signing and Encryption <jose.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/jose>, <mailto:jose-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/jose/>
List-Post: <mailto:jose@ietf.org>
List-Help: <mailto:jose-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/jose>, <mailto:jose-request@ietf.org?subject=subscribe>
X-List-Received-Date: Fri, 13 Oct 2023 00:09:51 -0000

Is it the consensus of the JOSE RFC committee that parsing a JWS payload
before it is trusted is acceptable?

Repeating the values in the header is certainly a viable solution, but that
doesn't address what to do if the JWS issuer does not do that.

I ask because, while I appreciate your suggestion, it doesn't address _why_
parsing any payload before it is verified is acceptable from a security
standpoint and should be supported by JWS libraries.  Is it a concession
the RFC committee has discussed?

Remember, a JWS payload can be anything at all - not just JSON, and even if
JSON, not necessarily Claims.  Parsing any stream of bytes well before they
become a Map<String,Object> could potentially enable remote code execution
attacks or other problems.

And even if the payload is Claims JSON, payloads are often significantly
larger than headers, so they're not the same from a risk perspective.

>