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

Cornelissen Eric <eric.cornelissen@aalto.fi> Fri, 21 August 2020 06:28 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 1C06F3A189C for <mls@ietfa.amsl.com>; Thu, 20 Aug 2020 23:28:33 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.088
X-Spam-Level:
X-Spam-Status: No, score=-2.088 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, 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 HiFf5QKVonNc for <mls@ietfa.amsl.com>; Thu, 20 Aug 2020 23:28:29 -0700 (PDT)
Received: from smtp-out-01.aalto.fi (smtp-out-01.aalto.fi [130.233.228.120]) (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 1098E3A1897 for <mls@ietf.org>; Thu, 20 Aug 2020 23:28:27 -0700 (PDT)
Received: from smtp-out-01.aalto.fi (localhost.localdomain [127.0.0.1]) by localhost (Email Security Appliance) with SMTP id AEA19115742_F3F6985B; Fri, 21 Aug 2020 06:28:21 +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-01.aalto.fi (Sophos Email Appliance) with ESMTPS id 3293011565D_F3F6985F; Fri, 21 Aug 2020 06:28:21 +0000 (GMT)
Received: from exng4.org.aalto.fi (130.233.223.23) 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; Fri, 21 Aug 2020 09:28:20 +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; Fri, 21 Aug 2020 09:28:20 +0300
From: Cornelissen Eric <eric.cornelissen@aalto.fi>
To: Joel Alwen <jalwen@wickr.com>
CC: Messaging Layer Security WG <mls@ietf.org>
Thread-Topic: [MLS] MLSPlaintext packets aren't authenticated using symmetric key schedule
Thread-Index: AQHWdXrucaCL3fuq50uSJkTFSJfo5ak/FzvdgAHRNICAATCjgA==
Date: Fri, 21 Aug 2020 06:28:20 +0000
Message-ID: <b9de81ae2d044b3289ba3d583e2c040d@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> <19861857231648008e6c280815c86546@aalto.fi>, <cdb2710c-3086-764b-2268-246d52eb537a@wickr.com>
In-Reply-To: <cdb2710c-3086-764b-2268-246d52eb537a@wickr.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_b9de81ae2d044b3289ba3d583e2c040daaltofi_"
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=Sobr6gu/NXbD9JpqNcIs5kRaioxkET0FrsJlqd9x7tA=; b=j1UHEsihA2+uu0qYHvzebqP/m5YrPtYBC8Bj6zO6yiRrfv50pBzng8tkLiQ7bb8VDlJW6rGJ0uDtaakwXfwl/j7O+VxEcD8Po93ChISTol5MbGuZxye5g3Ux9O3L57DMQxifxD/tuyDUqhvGJYODaiNnME+xw7KiV/vOlhbi+Ygz4/owzQm4CZ+U8uHp4YnMd+sQNCyQ69AoRVjZm+lAvBAKxMl3QC+uBTgvaYqbdr63i8r3h+lxhtHMuaZlJGza1cmby5oBlUXRo78RSCZEOm7WnhRx4+F2xyWT5QLv02pmV+1dvlD/SNs9KpaBNigwSn/DGnuDjOt2kDuPZ1th0A==
Archived-At: <https://mailarchive.ietf.org/arch/msg/mls/fjrEzLEBPlTkwCMu-mCrGXsirLw>
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: Fri, 21 Aug 2020 06:28:33 -0000

Hi Joël,


Thanks for getting back to me. I was indeed assuming A (i.e. that the updated credentials are fresh), but didn't think about the practicalities of getting new credentials. *After* such an update it should also prevent the adversary from forging Add and Remove proposals.


Regards,

Eric


________________________________
From: Joel Alwen <jalwen@wickr.com>
Sent: Thursday, August 20, 2020 6:01:55 PM
To: Cornelissen Eric; Richard Barnes; Raphael Robert
Cc: Messaging Layer Security WG
Subject: Re: [MLS] MLSPlaintext packets aren't authenticated using symmetric key schedule

Hey Eric,

What I think ur saying here is that an update proposal (MLSPLaintext) packets
should be signed using the sig key contained in that packet's key package. Am I
getting that right?

This makes no difference for the forging of Add and Remove proposals so those
attacks should still work as before. It might prevent forging updates but only
if both:

A) all updates proposals MUST update to new credentials and
B) when leaking Alice's state I only obtained 1 valid credential of hers.

But for that we'd have to mandate A) as thats not currently the case. I think
would be a mistake though, at least in general. Fresh certs may be comparatively
difficult to come by even for honest users. Yet that shouldn't stop them from
updating their HPKE keys frequently. At best, maybe this could be a group
specific policy? E.g. for deployments where fresh certs are very easy to come by
(say, generated locally) so people could be expected to refresh their sig keys
just as often as their HPKE keys.

> 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.

Yup, this seems more like a complimentary solution.

I'm curious about those replay attacks though! :-) If you're ready to tell us
more I'm all ears...

- Joël

On 19/08/2020 10:17, Cornelissen Eric wrote:
> 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_memberexternal proposals
> <https://github.com/mlswg/mls-protocol/blob/c3db39266505e9d202158d642d65918d35870e77/draft-ietf-mls-protocol.md#external-proposals>.
[https://avatars1.githubusercontent.com/u/36107802?s=400&v=4]<https://github.com/mlswg/mls-protocol/blob/c3db39266505e9d202158d642d65918d35870e77/draft-ietf-mls-protocol.md#external-proposals>

mls-protocol/draft-ietf-mls-protocol.md at c3db39266505e9d202158d642d65918d35870e77 · mlswg/mls-protocol · GitHub<https://github.com/mlswg/mls-protocol/blob/c3db39266505e9d202158d642d65918d35870e77/draft-ietf-mls-protocol.md#external-proposals>
github.com
MLS protocol. Contribute to mlswg/mls-protocol development by creating an account on GitHub.


> 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.


> <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.


>
> 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>
[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.


> 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
>