Re: [MLS] MLSPlaintext packets aren't authenticated using symmetric key schedule

Cornelissen Eric <eric.cornelissen@aalto.fi> Wed, 19 August 2020 08:17 UTC

Return-Path: <eric.cornelissen@aalto.fi>
X-Original-To: mls@ietfa.amsl.com
Delivered-To: mls@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id AFA093A1117 for <mls@ietfa.amsl.com>; Wed, 19 Aug 2020 01:17:55 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.086
X-Spam-Level:
X-Spam-Status: No, score=-2.086 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_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_REMOTE_IMAGE=0.01, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=aalto.fi
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 KuDUOrpOvAzJ for <mls@ietfa.amsl.com>; Wed, 19 Aug 2020 01:17:53 -0700 (PDT)
Received: from smtp-out-02.aalto.fi (smtp-out-02.aalto.fi [130.233.228.121]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 2F3CE3A111B for <mls@ietf.org>; Wed, 19 Aug 2020 01:17:50 -0700 (PDT)
Received: from smtp-out-02.aalto.fi (localhost.localdomain [127.0.0.1]) by localhost (Email Security Appliance) with SMTP id 59248271636_F3CE029B; Wed, 19 Aug 2020 08:17:45 +0000 (GMT)
Received: from exng1.org.aalto.fi (exng1.org.aalto.fi [130.233.223.20]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (Client CN "exng1.org.aalto.fi", Issuer "org.aalto.fi RootCA" (not verified)) by smtp-out-02.aalto.fi (Sophos Email Appliance) with ESMTPS id C632F271653_F3CE028F; Wed, 19 Aug 2020 08:17:44 +0000 (GMT)
Received: from exng6.org.aalto.fi (130.233.223.25) by exng1.org.aalto.fi (130.233.223.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3; Wed, 19 Aug 2020 11:17:44 +0300
Received: from exng4.org.aalto.fi (130.233.223.23) by exng6.org.aalto.fi (130.233.223.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3; Wed, 19 Aug 2020 11:17:44 +0300
Received: from exng4.org.aalto.fi ([fe80::4047:1ae:cfdf:c1a8]) by exng4.org.aalto.fi ([fe80::4047:1ae:cfdf:c1a8%18]) with mapi id 15.01.1979.003; Wed, 19 Aug 2020 11:17:44 +0300
From: Cornelissen Eric <eric.cornelissen@aalto.fi>
To: Richard Barnes <rlb@ipv.sx>, Raphael Robert <raphael=40wire.com@dmarc.ietf.org>
CC: Joel Alwen <jalwen@wickr.com>, Messaging Layer Security WG <mls@ietf.org>
Thread-Topic: [MLS] MLSPlaintext packets aren't authenticated using symmetric key schedule
Thread-Index: AQHWdXrucaCL3fuq50uSJkTFSJfo5ak/Fzvd
Date: Wed, 19 Aug 2020 08:17:44 +0000
Message-ID: <19861857231648008e6c280815c86546@aalto.fi>
References: <7d7283b6-8c70-d045-81c2-f552219869ad@wickr.com> <F5B1E029-D8B4-4BEA-BF7A-CDD531D662BD@wire.com>, <CAL02cgRTtZp+gHKA0hXxxEn_L6SWRRTJa-U+bhQUhpvM8qZ+Cg@mail.gmail.com>
In-Reply-To: <CAL02cgRTtZp+gHKA0hXxxEn_L6SWRRTJa-U+bhQUhpvM8qZ+Cg@mail.gmail.com>
Accept-Language: en-US, fi-FI
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-originating-ip: [130.233.0.5]
Content-Type: multipart/alternative; boundary="_000_19861857231648008e6c280815c86546aaltofi_"
MIME-Version: 1.0
X-SASI-RCODE: 200
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aalto.fi; h=from:to:cc:subject:date:message-id:references:in-reply-to:content-type:mime-version; s=its18; bh=lo7lt9YBAMXPJgV7KO54bgid16f8tnc3l0d8hGESm58=; b=e4WRnUoqdCyBCK3S+3dLhrEP4yb+0Fl0l09zqhXwEaFqW0RfqTqEtg0e0bfIswFFItGz6iDMEdnU1z6cwfc6WXHXeJmlp+HWggpJ/VrCl24prQ+0yftt4Wg+EAdm7DkdmWNO6+hjqUoLIfrGZkAgNoINXphWfxjH+FA7CL//Qr/SoHP4eu6Ulr1H0hY1D7+ejFxDqCsHEjCmNGyUDNHik6uW7NOOQxR4WvFYk418vVMO68+jrpJuGycjTXa95WULxzcCelwmr/HmbwEuCVxHditu3KE0agIXxa2Pk5TRLjmR9f7N7GZBt7PjTtIWvwLq2/jf8GSOU49Fc6YYSTeDfw==
Archived-At: <https://mailarchive.ietf.org/arch/msg/mls/Dot9Ya6kBSXcNzqOP4HpqUgDLaE>
Subject: Re: [MLS] MLSPlaintext packets aren't authenticated using symmetric key schedule
X-BeenThere: mls@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Messaging Layer Security <mls.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/mls>, <mailto:mls-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/mls/>
List-Post: <mailto:mls@ietf.org>
List-Help: <mailto:mls-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/mls>, <mailto:mls-request@ietf.org?subject=subscribe>
X-List-Received-Date: Wed, 19 Aug 2020 08:17:56 -0000

I was wondering what the implications are of using the key advertised in an update Proposal's KeyPackage for signing, instead of the long-term key pair, just like new_member external proposals<https://github.com/mlswg/mls-protocol/blob/c3db39266505e9d202158d642d65918d35870e77/draft-ietf-mls-protocol.md#external-proposals>ls>. I'm confident it prevents the original weakness pointed out by Joël, but I'm unsure as to whether or not it introduces any new problems.


Then again, I would be very much in favor of including something group-binding in handshake messages as it would prevent some replay attacks (*) that I have been considering for a while.


Regards,

Eric


(*): Replays from adversarially controlled groups where the attacker managed to have the group id, epoch, and tree structure to match those of a target group.


________________________________
From: Richard Barnes <rlb@ipv.sx>
Sent: Tuesday, August 18, 2020 6:26 PM
To: Raphael Robert
Cc: Joel Alwen; Messaging Layer Security WG
Subject: Re: [MLS] MLSPlaintext packets aren't authenticated using symmetric key schedule

Thanks for pointing this out, Joël.  I agree that the attacks you're describing should work as things are currently specified.  And they're salient, especially the "replace Alice in the group" one.

Also agree with Raphael is correct that Commit is not affected by this, since someone who is not a member won't be able to generate the right confirmation value.  However, I don't think this is actually the right design to adopt for a general solution to this problem.  Confirmation verifies group membership *after* processing the handshake message; the point here is that we should also have a membership check *before* processing handshake messages.  In particular, I would propose that we do need something additional on Commit messages as well as Proposals.

Thinking about solutions here, a couple of options come to mind:

1. Use MLSCiphertext, but with an integrity-only encapsulation
2. Incorporate in the signature something that is only known to the group (e.g., confirmation_key or MAC(confirmation_key; confirmed_transcript_hash || Proposal/Commit))

Option (1) has the appeal that you would only ever send MLSCiphertext, though switching between encrypted/not could be problematic.  Option (2) seems a lot more appealing: It doesn't add any overhead, since the group-secret value doesn't need to be sent.  And we already switch between the signature context that is added for group members vs. external.  In fact, I think option (2) would just amount to a one-line change to include an extra, secret value in the context at the top of the MLSPlaintextTBS struct.
https://github.com/mlswg/mls-protocol/blob/master/draft-ietf-mls-protocol.md#content-signing-and-encryption
[https://avatars1.githubusercontent.com/u/36107802?s=400&v=4]<https://github.com/mlswg/mls-protocol/blob/master/draft-ietf-mls-protocol.md#content-signing-and-encryption>

mls-protocol/draft-ietf-mls-protocol.md at master · mlswg/mls-protocol · GitHub<https://github.com/mlswg/mls-protocol/blob/master/draft-ietf-mls-protocol.md#content-signing-and-encryption>
github.com
MLS protocol. Contribute to mlswg/mls-protocol development by creating an account on GitHub.


The only thing that seems odd about (2) is overloading signature verification in that way, i.e., using the ability to generate a signature over a secret thing to prove you know the secret thing.  That doesn't seem obviously flawed to me, but worth thinking about.

Does that make sense to folks?

--Richard


On Tue, Aug 18, 2020 at 10:55 AM Raphael Robert <raphael=40wire.com@dmarc.ietf.org<mailto:40wire.com@dmarc.ietf.org>> wrote:
Hi Joel,

For context: this would only apply when applications use cleartext MLSPlaintext for HS messages. The recommendation is still to encrypt them and send them around as MLSCiphertext.
That being said, we said we would like to support scenarios where HS messages are not necessarily encrypted.

Question: would this attack work with Commit messages? I’m thinking that they would be rejected because the attacker cannot compute the confirmation_tag.

As you mention in the PS, the easy target would be Proposal messages.

I’d be interested to see what exactly you would propose as a mitigation mechanism.

Raphael

> On 18 Aug 2020, at 16:36, Joel Alwen <jalwen@wickr.com<mailto:jalwen@wickr.com>> wrote:
>
> Hey everyone,
>
> Something thats been bugging Marta Mularczyk and Daniel Jost and me for a bit
> now is that handshake messages sent out as MLSPlaintext packets are only
> authenticated using signatures, but not using the group's key schedule. For
> non-members that makes sense but for group members that's weaker than need be.
>
> Suppose Alice is in a group using signing key pair (spk, ssk). I corrupt her to
> learn ssk. Now I loose access to her device again. Later she generates a fresh
> key package with her same spk but a new HPKE key for her leaf. She sends out and
> update proposal for her new key package and someone commits to the update.
>
> Expected result: she (and the group at large) has achieved PCS again.
>
> Actual result: using her stolen ssk I can still forge a new proposal's (sent as
> MLSPlaintext packets) coming from Alice. Some things I could do with this power:
> - I can generate a new key package kp for Alice using her spk and some HPKE key
> she doesn't know. Then I forge an update proposal for Alice with kp. If it gets
> committed I've effectively kicked her out of the group.
> - I could forge Add's and Remove's coming from Alice, so I could trick the
> group into thinking Alice is trying to Add my account to the group or remove
> some other group member.
>
> Lemme know if I've missed something here in that scenario...
>
>
> If I didn't miss anything and the attacks really work as advertised then IMO
> this is kinda weak sauce and worth avoiding if possible. So to that end, how
> about we modify MLS such that MLSPlaintext packets coming from group members
> must also be authenticated using something from the application key schedule.
> Now the above attacks fail. As soon as Alice's update is gets committed I no
> longer know the group's key schedule and so can't forged packet from Alice. More
> generally, this brings the PCS guarantees when using MLSPlaintexts frameing in
> line with what we're getting from MLSCiphertext packets.
>
> Any thoughts?
>
> - Joël
>
>
>
> PS. For concreteness, we could probably extend the current mechanism for getting
> concistancy (the confirmation_tag) to also provide symmetric key authentication.
> E.g. include most of the MLSPlaintext content into whats being tagged by
> confirmation_tag. That would cover the case of a commit packet and doesn't even
> grow the size of MLSPlaintext packets over the current design.
>
> For a proposal packet we could also have a confirmation_tag but this one is
> computed using the *current* epoch's confirmation_key and confirmed_transcript_hash.
>
> _______________________________________________
> MLS mailing list
> MLS@ietf.org<mailto:MLS@ietf.org>
> https://www.ietf.org/mailman/listinfo/mls

_______________________________________________
MLS mailing list
MLS@ietf.org<mailto:MLS@ietf.org>
https://www.ietf.org/mailman/listinfo/mls