[COSE] New CBOR tag for sensitive data

Nuutti Kotivuori <naked@iki.fi> Sat, 07 December 2024 23:09 UTC

Return-Path: <naked@iki.fi>
X-Original-To: cose@ietfa.amsl.com
Delivered-To: cose@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 301BBC14F738 for <cose@ietfa.amsl.com>; Sat, 7 Dec 2024 15:09:17 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.105
X-Spam-Level:
X-Spam-Status: No, score=-2.105 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, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, 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 (1024-bit key) header.d=iki.fi
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 OpWVhOJ1_HuT for <cose@ietfa.amsl.com>; Sat, 7 Dec 2024 15:09:15 -0800 (PST)
Received: from meesny.iki.fi (meesny.iki.fi [195.140.195.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-256) server-digest SHA256) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 7639AC14F6B0 for <cose@ietf.org>; Sat, 7 Dec 2024 15:09:14 -0800 (PST)
Received: from mail-pg1-f173.google.com (mail-pg1-f173.google.com [209.85.215.173]) (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) (Authenticated sender: naked@iki.fi) by meesny.iki.fi (Postfix) with ESMTPSA id 4Y5P2b0SFyzyQX for <cose@ietf.org>; Sun, 8 Dec 2024 01:09:10 +0200 (EET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=meesny; t=1733612952; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type; bh=1BEYd2qJTu/CXIuVmThH1U1HgdnuECAt0rzq4iGL1RQ=; b=lFTYeWQHFXj2tG4YAGzbMj4Ikd8caS2j5beSvNAYk7zmospQ+HZGbO9UwrGsMyA/fWmC+6 6PAZjDqPs0XgPCj4cc02KOQk7wOAPNRAspMTLGRZG7CPX99Vjk9TMHqas/iaCAfHWSjKry rBqAEeioCyRSMjFjb6/mQzFFPe+E5o4=
ARC-Seal: i=1; s=meesny; d=iki.fi; t=1733612952; a=rsa-sha256; cv=none; b=wXqrSEetPx5ysdXiK72yo/rhEjhGVwAxmAGfeZNujMEvIFny0L4Jm6eJFUuUlEOrkPN/cz zXqetilkhwBN60XYnE/F6I5kLTBq8PU/GXkiEZwx4OiMhuv7tXAqI35Drxt7Ge9KSv3GUw A/QBMY1KOUh+61hC0LbClGuakfJ6DP4=
ARC-Authentication-Results: i=1; ORIGINATING; auth=pass smtp.auth=naked@iki.fi smtp.mailfrom=naked@iki.fi
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=meesny; t=1733612952; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type; bh=1BEYd2qJTu/CXIuVmThH1U1HgdnuECAt0rzq4iGL1RQ=; b=E9stOUAnYH+uJI+v4JwnwOzpxxJbykdwhJOpvokrhPqLmo/CcDj714Oss2CAJE8EcTQI0i yMFYy/gG5rCb9iyGNPqmGXc3QDmHYCagsY+C0YjYf1EGH5oCV+itTO6ipJIYqzp+58y/Li AzE85oe4KVvwRSos5Op/IVJDPhvBq1Q=
Received: by mail-pg1-f173.google.com with SMTP id 41be03b00d2f7-7f71f2b136eso2527033a12.1 for <cose@ietf.org>; Sat, 07 Dec 2024 15:09:10 -0800 (PST)
X-Gm-Message-State: AOJu0Yzka55ehknbg1gl+TP/L9tpENx+zwGXjL5GBKJ96DZCT3YLHeph hCtRB3uG+PxRmpR5EoQlXQSS/FFAgSxrT6qNOJP6ZLHTGqXot7m2FBnQ2ZSVVUTzTlMFHipdJ5K t8pucOGO/tSmYNjeLnFiqC1VMDQ==
X-Google-Smtp-Source: AGHT+IHE5NCf/Ub3HX9bAKlFlvDQ5hHnvbkVteUxPKuA7htyDEB5D8sCUGIS6GcNLZmBiL6cx7Sv/6AuAUesj0fDzNM=
X-Received: by 2002:a17:90a:c88f:b0:2ee:b875:6d30 with SMTP id 98e67ed59e1d1-2ef69e16b96mr11841355a91.9.1733612949134; Sat, 07 Dec 2024 15:09:09 -0800 (PST)
MIME-Version: 1.0
From: Nuutti Kotivuori <naked@iki.fi>
Date: Sun, 08 Dec 2024 01:08:57 +0200
X-Gmail-Original-Message-ID: <CADDY0Ska3_ZvVs+CEXEcF8vt6BaHXBqtb6U=cWm6NVzTti=T8w@mail.gmail.com>
Message-ID: <CADDY0Ska3_ZvVs+CEXEcF8vt6BaHXBqtb6U=cWm6NVzTti=T8w@mail.gmail.com>
To: cose@ietf.org
Content-Type: multipart/alternative; boundary="00000000000002ef560628b63816"
Message-ID-Hash: ADTO2LTLGHI2D7CNOU6NBBHA3N23CQXK
X-Message-ID-Hash: ADTO2LTLGHI2D7CNOU6NBBHA3N23CQXK
X-MailFrom: naked@iki.fi
X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-cose.ietf.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header
X-Mailman-Version: 3.3.9rc6
Precedence: list
Subject: [COSE] New CBOR tag for sensitive data
List-Id: CBOR Object Signing and Encryption <cose.ietf.org>
Archived-At: <https://mailarchive.ietf.org/arch/msg/cose/3H_vnD2A1hYfsGLRXYQ203cbVTg>
List-Archive: <https://mailarchive.ietf.org/arch/browse/cose>
List-Help: <mailto:cose-request@ietf.org?subject=help>
List-Owner: <mailto:cose-owner@ietf.org>
List-Post: <mailto:cose@ietf.org>
List-Subscribe: <mailto:cose-join@ietf.org>
List-Unsubscribe: <mailto:cose-leave@ietf.org>

Hi all,

I am posting this as a complete outsider to any of the IETF stuff.
Apologies if that is not appropriate.

I recently wrote a specification for a new CBOR tag for flagging sensitive
values such as password, encryption keys, credit card information or GDPR
information, so that generic decoders may treat them differently.

This is intentionally unpublished right now:

https://gist.github.com/nakedible/fa872f5a59d30d9fbf39d7b26342d54c

I think this might be of special interest to COSE in general.

Right now the situation is that in all the messages and key formats, the
information on which values are critical to keep confidential and which
values are not requires full semantic understanding of the messages. As a
concrete example, a COSE symmetric key is a map with keys 1, 2 and -1, and
the -1 key contains the symmetric secret that should be kept confidential.
Without understanding the full semantics of the message, it's impossible to
know that the value for -1 is confidential and the value for 1 is not.

This means it is impossible to use any generic CBOR decoders to read keys
or any other messages that might contain something confidential - as the
confidential value gets already exposed to a non-confidential data buffer
during decoding time. The "sensitive data" tag would allow a generic
decoder to place such values in a data structure that automatically
prevents logging of the value and which zeroizes the memory when
unallocating it, allowing more specific processing to take over on the
semantic side from there.

If this were to get a low tag value allocation from IETF, the increase in
message length might be just one byte per sensitive data element, or two
bytes. Also, even if in theory adding such a tag should be backward
compatible, I believe in practice it's likely not - so I'm not sure if
there's any sensitive way to introduce this for existing messages.

In any case, I just wanted to quickly pitch the idea and see if you think
it might be interesting to promote to an actual RFC or something.

But if not, I will just publish the specification myself and get a tag
allocated to it through the normal channels.

Thank you in advance,
-- Naked