Re: [lamps] draft-ietf-lamps-rfc3709bis-01 security, reliability, and privacy considerations

Daniel Kahn Gillmor <dkg@fifthhorseman.net> Wed, 30 March 2022 19:21 UTC

Return-Path: <dkg@fifthhorseman.net>
X-Original-To: spasm@ietfa.amsl.com
Delivered-To: spasm@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 695383A0959 for <spasm@ietfa.amsl.com>; Wed, 30 Mar 2022 12:21:30 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.316
X-Spam-Level:
X-Spam-Status: No, score=-1.316 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, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, URIBL_BLOCKED=0.001] autolearn=no autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=neutral reason="invalid (unsupported algorithm ed25519-sha256)" header.d=fifthhorseman.net header.b=KuijFXQM; dkim=pass (2048-bit key) header.d=fifthhorseman.net header.b=TRfF80RR
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 nWwjQsUeT-_o for <spasm@ietfa.amsl.com>; Wed, 30 Mar 2022 12:21:25 -0700 (PDT)
Received: from che.mayfirst.org (unknown [162.247.75.117]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 7EC9F3A07DE for <spasm@ietf.org>; Wed, 30 Mar 2022 12:21:25 -0700 (PDT)
DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/simple; d=fifthhorseman.net; i=@fifthhorseman.net; q=dns/txt; s=2019; t=1648668083; h=from : to : subject : in-reply-to : references : date : message-id : mime-version : content-type : from; bh=XIBBD69aDvSwyu3WvafsqGd67Yt+oBTd6++ZDvX4VCI=; b=KuijFXQMzDXPRY7/ovkKcdkIUfqZcuueTAwtdCCO9fRmvR2C88CIu6fivnFZ29FcF2KuH nrejb7caupFYdhZAg==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=fifthhorseman.net; i=@fifthhorseman.net; q=dns/txt; s=2019rsa; t=1648668083; h=from : to : subject : in-reply-to : references : date : message-id : mime-version : content-type : from; bh=XIBBD69aDvSwyu3WvafsqGd67Yt+oBTd6++ZDvX4VCI=; b=TRfF80RRYQatpeBCWBctnOBjZ9mVOqeVYqp4b0N1JsRgnd1/0pzQxmfHNlfbFN53QpboW nhJS/fMf79XPD7yLzzlbNwA2ww4VaBAF0MMQhE7Iyz3DuuBqkSd7l3tOqWPa6s9lb7ImWsD byBM4hm7XdTvuV1cCGEdwthj/OVevzMYUG9DmcQdd4A1o2fjnbbQpS2uTh0JJvz6yKSMFpl Vp2Q1vgzq//+1bUkb6mab7EWEj9A09EVQCFPO+thj8zzVroWhPgVjSMpd7P2/J2EEYNzqvm A1pzX3654dZCadyK3O1l3rl7kjS4KiAfqHgdmdWGuZuP8tI/OYmIoasiVwdQ==
Received: from fifthhorseman.net (lair.fifthhorseman.net [108.58.6.98]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by che.mayfirst.org (Postfix) with ESMTPSA id B235EF9AF; Wed, 30 Mar 2022 15:21:23 -0400 (EDT)
Received: by fifthhorseman.net (Postfix, from userid 1000) id 6336D205D6; Wed, 30 Mar 2022 15:20:37 -0400 (EDT)
From: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
To: Stefan Santesson <stefan@aaa-sec.com>, LAMPS WG <spasm@ietf.org>
In-Reply-To: <25b02696-8d29-590a-540a-e8b236ee6178@aaa-sec.com>
References: <877d8hx019.fsf@fifthhorseman.net> <426fc2e8-0118-7d3b-1813-ef1cb9ed3426@aaa-sec.com> <87ee2ko141.fsf@fifthhorseman.net> <25b02696-8d29-590a-540a-e8b236ee6178@aaa-sec.com>
Autocrypt: addr=dkg@fifthhorseman.net; prefer-encrypt=mutual; keydata= mDMEX+i03xYJKwYBBAHaRw8BAQdACA4xvL/xI5dHedcnkfViyq84doe8zFRid9jW7CC9XBiI0QQf FgoAgwWCX+i03wWJBZ+mAAMLCQcJEOCS6zpcoQ26RxQAAAAAAB4AIHNhbHRAbm90YXRpb25zLnNl cXVvaWEtcGdwLm9yZ/tr8E9NA10HvcAVlSxnox6z62KXCInWjZaiBIlgX6O5AxUKCAKbAQIeARYh BMKfigwB81402BaqXOCS6zpcoQ26AADZHQD/Zx9nc3N2kj13AUsKMr/7zekBtgfSIGB3hRCU74Su G44A/34Yp6IAkndewLxb1WdRSokycnaCVyrk0nb4imeAYyoPtBc8ZGtnQGZpZnRoaG9yc2VtYW4u bmV0PojRBBMWCgCDBYJf6LTfBYkFn6YAAwsJBwkQ4JLrOlyhDbpHFAAAAAAAHgAgc2FsdEBub3Rh dGlvbnMuc2VxdW9pYS1wZ3Aub3JnL0Gwxvypz2tu1IPG+yu1zPjkiZwpscsitwrVvzN3bbADFQoI ApsBAh4BFiEEwp+KDAHzXjTYFqpc4JLrOlyhDboAAPkXAP0Z29z7jW+YzLzPTQML4EQLMbkHOfU4 +s+ki81Czt0WqgD/SJ8RyrqDCtEP8+E4ZSR01ysKqh+MUAsTaJlzZjehiQ24MwRf6LTfFgkrBgEE AdpHDwEBB0DkKHOW2kmqfAK461+acQ49gc2Z6VoXMChRqobGP0ubb4kBiAQYFgoBOgWCX+i03wWJ BZ+mAAkQ4JLrOlyhDbpHFAAAAAAAHgAgc2FsdEBub3RhdGlvbnMuc2VxdW9pYS1wZ3Aub3Jnfvo+ nHoxDwaLaJD8XZuXiaqBNZtIGXIypF1udBBRoc0CmwICHgG+oAQZFgoAbwWCX+i03wkQPp1xc3He VlxHFAAAAAAAHgAgc2FsdEBub3RhdGlvbnMuc2VxdW9pYS1wZ3Aub3JnaheiqE7Pfi3Atb3GGTw+ jFcBGOaobgzEJrhEuFpXREEWIQQttUkcnfDcj0MoY88+nXFzcd5WXAAAvrsBAIJ5sBg8Udocv25N stN/zWOiYpnjjvOjVMLH4fV3pWE1AP9T6hzHz7hRnAA8d01vqoxOlQ3O6cb/kFYAjqx3oMXSBhYh BMKfigwB81402BaqXOCS6zpcoQ26AADX7gD/b83VObe14xrNP8xcltRrBZF5OE1rQSPkMNy+eWpk eCwA/1hxiS8ZxL5/elNjXiWuHXEvUGnRoVj745Vl48sZPVYMuDgEX+i03xIKKwYBBAGXVQEFAQEH QIGex1WZbH6xhUBve5mblScGYU+Y8QJOomXH+rr5tMsMAwEICYjJBBgWCgB7BYJf6LTfBYkFn6YA CRDgkus6XKENukcUAAAAAAAeACBzYWx0QG5vdGF0aW9ucy5zZXF1b2lhLXBncC5vcmcEAx9vTD3b J0SXkhvcRcCr6uIDJwic3KFKxkH1m4QW0QKbDAIeARYhBMKfigwB81402BaqXOCS6zpcoQ26AAAX mwD8CWmukxwskU82RZLMk5fm1wCgMB5z8dA50KLw3rgsCykBAKg1w/Y7XpBS3SlXEegIg1K1e6dR fRxL7Z37WZXoH8AH
Date: Wed, 30 Mar 2022 15:20:36 -0400
Message-ID: <87v8vvmem3.fsf@fifthhorseman.net>
MIME-Version: 1.0
Content-Type: multipart/signed; boundary="=-=-="; micalg="pgp-sha256"; protocol="application/pgp-signature"
Archived-At: <https://mailarchive.ietf.org/arch/msg/spasm/TLDbxF9FEyghxg8gKSu6QPq7HFw>
Subject: Re: [lamps] draft-ietf-lamps-rfc3709bis-01 security, reliability, and privacy considerations
X-BeenThere: spasm@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: "This is a venue for discussion of doing Some Pkix And SMime \(spasm\) work." <spasm.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/spasm>, <mailto:spasm-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/spasm/>
List-Post: <mailto:spasm@ietf.org>
List-Help: <mailto:spasm-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/spasm>, <mailto:spasm-request@ietf.org?subject=subscribe>
X-List-Received-Date: Wed, 30 Mar 2022 19:21:39 -0000

On Wed 2022-03-30 13:46:51 +0200, Stefan Santesson wrote:
> 1) This is not a new design:
>
> This is not a new standard we are designing. If I was designing this
> extension today, my approach would be much more pragmatic and I would
> simplify this quite a bit. But that is not a luxury we have. The purpose
> of this update is to merge 2 existing RFC:s and basically get rid of
> mandatory use of SHA-1. That's it.
>
> Therefore, even how much I can agree on structural issues on the design,
> we have to stick with it, or alternatively stop this update and let the
> old RFC:s keep living instead.

Thanks for this clarification of the constraints.  I understand them,
and i'm not asking to actually change the structure of the wire format
objects.

I very much appreciate the move from SHA-1 to the digest algorithm used
in the signature -- that strikes me as the right approach.  But it also
occurs to me that i don't know whether all possible future signature
X.509 certificates will even have a "one-way hash function associated
with the certificate signature" -- maybe the draft can describe an
algorithmic way to identify the one-way hash algorithm in question?  I
mean, i know that a Certificate's signatureAlgorithm field
AlgorithmIdentifier OID of sha256WithRSAEncryption (1 2 840 113549 1 1
11) maps to id-sha256 (2 16 840 1 101 3 4 2 1).  But i don't know for
certain that all possible Certificate.signatureAlgorithm
AlgorithmIdentifiers have a well-defined hash.

Is there a straightforward mapping from the
Certificate.signatureAlgorithm AlgorithmIdentifier to
HashAlgAndValue.hashAlg AlgorithmIdentifier?

More work is needed here for a variety of different reasons that don't
touch the bits on the wire:

The document is internally-contradictory at several points; the text is
frequently unclear; the title and introduction don't offer a
straightforward description of what is provided; there are at least two
serious security considerations (the phishing attack that i outlined;
the risks of large attack surface of polymorphic image or audio
renderers) that are not discussed; there are multiple privacy
considerations that are not discussed; the examples are not easy to use
to confirm interoperability.

An update represents the opportunity to resolve *all* of these issues
without affecting the bits on the wire at all.  The point of these
specfications is to provide clarity for implementers so that we get a
robust, secure, interoperable ecosystem, right?

> 2) Privacy concerns
>
> On the privacy issues, I don't say that we should add some well thought
> out sentences in a privacy considerations section. I personally do not
> feel qualified enough to do it. I would welcome a few sentences that
> would do the job that we could include in this draft.

I don't think that a few sentences are sufficient to address the privacy
considerations raised by these mechanisms in today's network
environment.  Some text and some framing will need to change at the very
least.

If it turns out that a clearer understanding of the privacy concerns
happens to also spur ideas for a backward-compatible extension of the
wire format to make it cheaper/easier to embed the media directly, that
would be an elegant outcome but i won't hold my breath on that.

> 3) Mime type for LogotypeData
>
> I see no advantages of registering a mime type for this. As the expected
> structure of the referenced data is known, and must be validated anyway
> both i terms of content and structure, I'm not helped by learning what
> mime type the server provides in HTML. I will simply extract the bytes
> of the data, validate it against the hash and then attempt to parse it
> as DER encoded LogotypeData.
>
> Clients should disregard any mime type declarations and should not fail
> because this header is not set as expected.

In this case, i agree with you -- the client can probably ignore the
server's offered media type, or at least accept an
application/octet-stream media type.

But if the server says "this is an image/png" when you're expecting a
DER-encoded LogotypeData, shouldn't a defensively-programmed system
reject the HTTP response?

That doesn't mean that we shouldn't register a media type for this
specific format, though.  Media type registration is a mutual aid sort
of situation.  For example, there may be implemetnations of other
protocols that expect some other data types, and they themselves might
do ugly things if they receive a DER-encoded LogotypeData instead.

By defining and encouraging an explicit label of what sort of data the
HTTP server is emitting, we can help isolate these protocols from each
other.

Is there a specific objection to registering the media type?  As far as
i can tell, media type registrations have no cost, and this looks to me
like a very well-defined binary format, with a clear reference that the
media type registration can point to.  what would be the downside?

> 4) The rest.
>
> I feel bad that I don't provide detailed responses to all the effort you
> put into this, but I have to save that to later. Better to provide a
> quick response than no response. But if any of my comments would change
> the way you feel about things you just posted, it would make it easier
> to respond to them.

I understand, and i don't expect repsonses or fixes to each point all at
once-- there are a lot of issues that need fixing, unfortunately, and
it's easy for some to get lost in this back-and-forth format, despite my
trying to give each distinct issue a separate identifier.

Anyway, i appreciate your giving a prompt response, and i'm game to help
work through the details if you're interested in my help.

If you want to make collaboration easier, i'll reiterate my
recommendation for revision control of the document's markdown source
and an issue tracker.

I set up https://gitlab.com/dkg/lamps-rfc3709bis and populated the repo
with the markdown source from the first three drafts as an example of
how that kind of collaboration could work if you're interested.  Pushes
to the main branch there will automatically update a putative "editor's
copy" at https://dkg.gitlab.io/lamps-rfc3709bis/ after a few minutes.

If you want to use this repo, please let me know what your gitlab handle
is and i'll add you as an owner to that group.  I can then work on
transferring the points i raised into specific issues, which we can then
try to fix.

If you have a different way that you'd prefer to keep track of
outstanding issues and work through their fixes, let me know and i can
try to populate it with the concerns that i've found.

All the best,

    --dkg