Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(mls-rs): Verify the update path even in case of a self removal #224

Merged

Conversation

ManevilleF
Copy link
Contributor

Description of changes:

In the case of a self removal commit we early return before verifying the update_path, This PR drops the early return and self removals verify the update_path and adds some checks in following operations to avoid:

  • Applying the update_path for a self removal
  • Updating the key schedule for a self removal

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 and MIT license.

@mulmarta
Copy link
Contributor

I'm wondering @ManevilleF how much security this check is adding? We're verifying a path that we're going to immediately delete since we're removed and its not useful for us. And note that if we're removed, we anyway can't verify everything inside the commit such as the confirmation tag.

@ManevilleF
Copy link
Contributor Author

@mulmarta

We are verifying that:

  • the UpdatePath is well-formed
  • that the committer is valid (unexpired, unrevoked)
  • that the committer new LeafNode is also valid (unexpired, unrevoked) also also matches the local policy (with 'valid_successor')

All these checks mostly prevent group fragmentation (in this case ghost clients) since the other unremoved members would simply ignore this commit.

It could also let a member whose credential is revoked but not yet removed from the group to remove anyone he wants.

@mulmarta
Copy link
Contributor

It could also let a member whose credential is revoked but not yet removed from the group to remove anyone he wants.

I didn't actually realize we re-check the credential even if it didn't change, that makes sense.

All these checks mostly prevent group fragmentation (in this case ghost clients)

Just for the sake of understanding, fragmentation by malicious committers is unavoidable. For example, flipping a bit in the last ciphertext on the update path splits the group in half -- clients who don't use this ciphertext (those in the same half of the tree as the committer) accept, others reject.

So if the committer is honest, it won't generate a bad path (if it's a ghost, commit will fail). If it's dishonest, it can fragment anyway. So the space of fragmenting attacks this prevents seems rather narrow?

@ManevilleF
Copy link
Contributor Author

So if the committer is honest, it won't generate a bad path (if it's a ghost, commit will fail). If it's dishonest, it can fragment anyway. So the space of fragmenting attacks this prevents seems rather narrow?

fragmentation by malicious committers is unavoidable, yet. This just closes one small door even though as you pointed out there's a blatant gateway opened to cause fragmentation.
This could also impact ill-implemented clients (committer commits even though its credential is revoked) so I think it's still worth it

@tomleavy tomleavy merged commit 3add368 into awslabs:main Dec 20, 2024
17 checks passed
@ManevilleF ManevilleF deleted the feat/check_update_path_self_removal branch December 20, 2024 17:59
tomleavy added a commit that referenced this pull request Jan 7, 2025
* Fix CI (#223)

* feat(mls-rs): Verify the update path even in case of a self removal (#224)

* Fix bug where double-hitting a ciphertext deleted the whole ratchet (#228)

Co-authored-by: Marta Mularczyk <[email protected]>

* Work around rust < 1.78 crash (#231)

Somehow the DWARF info generated by the compiler for the
`hash`-replacement assignment is confusing to LLVM, which crashes.

By using a different form for the same operation, the compiler is happy.

* Avoid intermediate Vec in TreeKemPublic::update_hashes (#230)

[slice, slice].concat() creates an intermediate Vec, which can be
avoided by chaining updated_leaves and trailing_blanks before the first
Vec is created.

* Add API for deleting exporters (#227)

* Add API for deleting exporters

* Apply suggestions from code review

Co-authored-by: Stephane Raux <[email protected]>

---------

Co-authored-by: Marta Mularczyk <[email protected]>
Co-authored-by: Tom Leavy <[email protected]>
Co-authored-by: Stephane Raux <[email protected]>

* Key package generation 1.x

* Fix clippy warnings

* Initial implementation of group join 1.x

* Add example for 1x API

* Apply suggestions from code review

* Add SigningData struct

* Fixup

* Add more tests

* Fixup

* Fixup

---------

Co-authored-by: Félix Lescaudey de Maneville <[email protected]>
Co-authored-by: Marta Mularczyk <[email protected]>
Co-authored-by: Mike Hommey <[email protected]>
Co-authored-by: Tom Leavy <[email protected]>
Co-authored-by: Stephane Raux <[email protected]>
mulmarta added a commit that referenced this pull request Jan 8, 2025
* Fix CI (#223)

* feat(mls-rs): Verify the update path even in case of a self removal (#224)

* Fix bug where double-hitting a ciphertext deleted the whole ratchet (#228)

Co-authored-by: Marta Mularczyk <[email protected]>

* Work around rust < 1.78 crash (#231)

Somehow the DWARF info generated by the compiler for the
`hash`-replacement assignment is confusing to LLVM, which crashes.

By using a different form for the same operation, the compiler is happy.

* Avoid intermediate Vec in TreeKemPublic::update_hashes (#230)

[slice, slice].concat() creates an intermediate Vec, which can be
avoided by chaining updated_leaves and trailing_blanks before the first
Vec is created.

* Add API for deleting exporters (#227)

* Add API for deleting exporters

* Apply suggestions from code review

Co-authored-by: Stephane Raux <[email protected]>

---------

Co-authored-by: Marta Mularczyk <[email protected]>
Co-authored-by: Tom Leavy <[email protected]>
Co-authored-by: Stephane Raux <[email protected]>

* Key package generation 1.x

* Fix clippy warnings

* Initial implementation of group join 1.x

* Add example for 1x API

* Apply suggestions from code review

* Add SigningData struct

* Fixup

* Add more tests

* Fixup

* Fixup

---------

Co-authored-by: Félix Lescaudey de Maneville <[email protected]>
Co-authored-by: Marta Mularczyk <[email protected]>
Co-authored-by: Mike Hommey <[email protected]>
Co-authored-by: Tom Leavy <[email protected]>
Co-authored-by: Stephane Raux <[email protected]>
mulmarta added a commit that referenced this pull request Jan 14, 2025
* Fix CI (#223)

* feat(mls-rs): Verify the update path even in case of a self removal (#224)

* Fix bug where double-hitting a ciphertext deleted the whole ratchet (#228)

Co-authored-by: Marta Mularczyk <[email protected]>

* Work around rust < 1.78 crash (#231)

Somehow the DWARF info generated by the compiler for the
`hash`-replacement assignment is confusing to LLVM, which crashes.

By using a different form for the same operation, the compiler is happy.

* Avoid intermediate Vec in TreeKemPublic::update_hashes (#230)

[slice, slice].concat() creates an intermediate Vec, which can be
avoided by chaining updated_leaves and trailing_blanks before the first
Vec is created.

* Add API for deleting exporters (#227)

* Add API for deleting exporters

* Apply suggestions from code review

Co-authored-by: Stephane Raux <[email protected]>

---------

Co-authored-by: Marta Mularczyk <[email protected]>
Co-authored-by: Tom Leavy <[email protected]>
Co-authored-by: Stephane Raux <[email protected]>

* Key package generation 1.x

* Fix clippy warnings

* Initial implementation of group join 1.x

* Add example for 1x API

* Apply suggestions from code review

* Add SigningData struct

* Fixup

* Add more tests

* Fixup

* Fixup

---------

Co-authored-by: Félix Lescaudey de Maneville <[email protected]>
Co-authored-by: Marta Mularczyk <[email protected]>
Co-authored-by: Mike Hommey <[email protected]>
Co-authored-by: Tom Leavy <[email protected]>
Co-authored-by: Stephane Raux <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants