[core] (not only) RD: Authorized servers

"Christian M. Amsüss" <christian@amsuess.com> Wed, 21 October 2020 00:03 UTC

Return-Path: <christian@amsuess.com>
X-Original-To: core@ietfa.amsl.com
Delivered-To: core@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id E8F183A0A68 for <core@ietfa.amsl.com>; Tue, 20 Oct 2020 17:03:36 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.899
X-Spam-Level:
X-Spam-Status: No, score=-1.899 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
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 MWmsAJ53rG0Y for <core@ietfa.amsl.com>; Tue, 20 Oct 2020 17:03:34 -0700 (PDT)
Received: from prometheus.amsuess.com (prometheus.amsuess.com [5.9.147.112]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 5EDA13A0A64 for <core@ietf.org>; Tue, 20 Oct 2020 17:03:33 -0700 (PDT)
Received: from poseidon-mailhub.amsuess.com (unknown [IPv6:2a02:b18:c13b:8010:a800:ff:fede:b1bd]) by prometheus.amsuess.com (Postfix) with ESMTPS id E13E54012D for <core@ietf.org>; Wed, 21 Oct 2020 02:03:30 +0200 (CEST)
Received: from poseidon-mailbox.amsuess.com (hermes.amsuess.com [10.13.13.254]) by poseidon-mailhub.amsuess.com (Postfix) with ESMTP id 19D2AAB for <core@ietf.org>; Wed, 21 Oct 2020 02:03:28 +0200 (CEST)
Received: from hephaistos.amsuess.com (unknown [IPv6:2a02:b18:c13b:8010:b5e3:21a5:c6eb:f5c2]) by poseidon-mailbox.amsuess.com (Postfix) with ESMTPSA id 8DB40121 for <core@ietf.org>; Wed, 21 Oct 2020 02:03:27 +0200 (CEST)
Received: (nullmailer pid 483397 invoked by uid 1000); Wed, 21 Oct 2020 00:03:27 -0000
Date: Wed, 21 Oct 2020 02:03:27 +0200
From: "Christian M. Amsüss" <christian@amsuess.com>
To: Core WG mailing list <core@ietf.org>
Message-ID: <20201021000327.GB303030@hephaistos.amsuess.com>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg="pgp-sha256"; protocol="application/pgp-signature"; boundary="oyUTqETQ0mS9luUI"
Content-Disposition: inline
Archived-At: <https://mailarchive.ietf.org/arch/msg/core/JyW0XAkXre1wvKoNxMwegOUCywc>
Subject: [core] (not only) RD: Authorized servers
X-BeenThere: core@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: "Constrained RESTful Environments \(CoRE\) Working Group list" <core.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/core>, <mailto:core-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/core/>
List-Post: <mailto:core@ietf.org>
List-Help: <mailto:core-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/core>, <mailto:core-request@ietf.org?subject=subscribe>
X-List-Received-Date: Wed, 21 Oct 2020 00:03:37 -0000

Hello CoRE,

one of the outstanding issues in RD is server authorization with respect
to operations on particular paths. This continues an ACE thread[1] I
regrettably missed to follow up on, but simplifies the examples based on
the recent interims. While originally phrased as the attacker tricking
the server into using the client's good credentials for something the
client did not intend, here they are phrased now in terms of server
authorization as relevant for RD discovery and RD security policies.

For two examples, a client needs to trust a server to provide a service,
but has received misleading hints that cause disagreement between the
client and the server about the performed operation.

Example 1
=========

An RD with a "links are confidential" policy also operates a bulletin
board at `/bb`. During the unprotected discovery phase, the endpoint is
fed a link `<coap://rd.example.com/bb>;rt=core.rd`.

The client connects to rd.example.com, verifies that its server
credentials are good for an RD that will reveal links posted to it only
to authorized lookup clients.

It then posts all its links to /bb, where anyone who knows to use a
bulletin board can read them.

Example 2
=========

A time server also exposes its current core temperature as
`/monitoring/temp`.

A malicious RD operator modifies the time server's registration to read
`<coap://time.example.com/monitoring/temp>;rt=unixtime`.

A starting device in the network asks the RD for any rt=unixtime,
verifies that time.example.com is indeed authorized to give the right
time, and wakes up on the morning of January 1st, 1970.

Problem summary
===============

The client has an abstract intention with an operation, which it checks
against the server's authorization. Then it forms that intention, with
additional unverified knowledge about the server, into a request, which
it protects. The server then reconstructs that intention with its
authoritative knowledge of itself, and uses any client provided
credentials to act on it.

If the client's knowledge about the server is erroneous, the intentions
are misaligned. Neither is the intention protected, nor does the client
point out the claims it wants to hold the server to in its request (or,
in the original examples from the ACE thread, express the precise claims
about itself it intends the server to assess).

Solution approaches
===================

In the ACE thread back then, Jim said that he'd expect the client to use
different keys (originally in talking to the AS, and thus different keys
in talking to the RS). Doing that to the end would probably result in
the devices having to handle a lot more keys, something like one for any
operation that could be mixed up with any other?

Michael in the last interim mentioned that in OAuth it's common to only
run one service on one host for the very same reason. Kind of boils down
to the same thing, as virtual-hosting these services would create
multiple keys.

My approach in the -25 RD Section 7.2 is to (losely, there; would
need stronger and more precise wording) say that any information that
any information using which intention is encoded in the request in a
lossy way is to be rechecked from the origin server. That'd be more or
less straightforward for example 1, but incur an additional costly
recheck with the origin server about many things that could be learned
efficiently from the RD.

Does any of that solve the issues?

Can we do any better?

How do we put that into RD to satisfy the small comment about Section
7.2 that opens this can of worms? Is there anything quotable on OAuth's
best practices on multiple services on the same host?

Best regards
Christian

[1]: https://mailarchive.ietf.org/arch/msg/ace/TLIbCfU0unm1el99Kjo2eoB37Qw/

-- 
To use raw power is to make yourself infinitely vulnerable to greater powers.
  -- Bene Gesserit axiom