Repository navigation
Enforce app_data_dictionary immutability for bare GroupContextExtensions proposals - #2125
Merged
franziskuskiefer merged 1 commit intoJul 23, 2026
Conversation
…tensions proposals draft-ietf-mls-extensions §4.7-6 requires that, once a group's required_capabilities include the AppDataUpdate proposal type, a GroupContextExtensions proposal MUST NOT add, remove, or modify the app_data_dictionary extension. The check in validate_app_data_update_proposals_and_group_context was gated behind an early return that fires whenever a commit carries no AppDataUpdate proposals, so a bare GroupContextExtensions proposal could rewrite the app_data_dictionary directly, bypassing the AppDataUpdate machinery entirely. Hoist the dictionary-immutability check above that early return so it binds every commit carrying a GroupContextExtensions proposal, and evaluate it against the required_capabilities in effect either before or after the commit — a sender cannot evade it by also dropping AppDataUpdate from required_capabilities, and the migrating commit that introduces both the dictionary and AppDataUpdate is unaffected. Adds a regression test covering a bare GroupContextExtensions proposal that touches the dictionary with no accompanying AppDataUpdate proposal.
tylerhawkes
added a commit
to xmtp/openmls
that referenced
this pull request
Jul 22, 2026
…ons proposals Replays open upstream PR openmls#2125: the dictionary-immutability check ran after the no-AppDataUpdate early return, so a commit carrying only a GroupContextExtensions proposal could rewrite the app_data_dictionary directly, bypassing the AppDataUpdate machinery. Move the check ahead of the early return and trigger it when either the current or the proposed required_capabilities contains AppDataUpdate. Drop at the upstream merge after openmls#2125 lands.
tylerhawkes
added a commit
to xmtp/libxmtp
that referenced
this pull request
Jul 22, 2026
…+ GCE dict-immutability fix Moves the openmls pin from e125674 (the pre-merge fork line) to fork main 3fabbf2, which carries the merged upstream (openmls/openmls 65396d8), the replayed fork storage format (xmtp/openmls#56), and the GCE dict-immutability security fix (upstream openmls/openmls#2125, replayed as #56's fifth commit). Ripple effects absorbed here: - extensions-draft-08 -> extensions-draft (upstream #2060 rename), and the 0x004D XWing ciphersuite is now behind draft-ietf-mls-pq-ciphersuites, so that feature is enabled. - tls_codec 0.4.2 -> 0.5 to match openmls: trait impls on openmls types are version-specific. Encode side is byte-identical; the decode side gains strict length-boundary enforcement (rejects non-canonical encodings no conforming encoder produces) plus allocation hardening. - xmtp/hpke-rs fork bumped to the libcrux series hpke-rs 0.7.0 uses so hax-lib unifies at 0.3.7 with the new openmls chain; libxmtp's direct hpke usage stays on the forked 0.6.1 API (0x004D welcome codepoint). - App-data processing ported to upstream's redesigned flow: process_message now returns commits covering AppDataUpdate proposals as UnresolvedAppDataCommit; the wrapper interprets the (already reference-resolved) proposals and resumes staging via resolve_app_data_commit. The PAUSE-BEFORE-PARSE floor check moves to a pre-processing content_type() check (pause-only, so the unauthenticated signal is safe) with a staged-commit backstop. - New ProcessedMessageContent variants handled: OwnPrivateMessage is a clean skip (replaces the opaque decryption error own fanned-back messages used to produce), OwnPendingCommit and UnresolvedAppDataCommit are defensive errors (unreachable under the pure-ciphertext wire policy / the resolving wrapper). - Proposal::_AppAck arms dropped (variant removed upstream). - cargo-deny: all seven openmls/libcrux advisory allowances removed (RUSTSEC-2026-0124, -0207..-0212) — this bump is the fix they were waiting on — plus stale RUSTSEC-2021-0139 (ansi_term left the graph).
tylerhawkes
added a commit
to xmtp/libxmtp
that referenced
this pull request
Jul 22, 2026
…+ GCE dict-immutability fix Moves the openmls pin from e125674 (the pre-merge fork line) to fork main 3fabbf2, which carries the merged upstream (openmls/openmls 65396d8), the replayed fork storage format (xmtp/openmls#56), and the GCE dict-immutability security fix (upstream openmls/openmls#2125, replayed as #56's fifth commit). Ripple effects absorbed here: - extensions-draft-08 -> extensions-draft (upstream #2060 rename), and the 0x004D XWing ciphersuite is now behind draft-ietf-mls-pq-ciphersuites, so that feature is enabled. - tls_codec 0.4.2 -> 0.5 to match openmls: trait impls on openmls types are version-specific. Encode side is byte-identical; the decode side gains strict length-boundary enforcement (rejects non-canonical encodings no conforming encoder produces) plus allocation hardening. - xmtp/hpke-rs fork bumped to the libcrux series hpke-rs 0.7.0 uses so hax-lib unifies at 0.3.7 with the new openmls chain; libxmtp's direct hpke usage stays on the forked 0.6.1 API (0x004D welcome codepoint). - App-data processing ported to upstream's redesigned flow: process_message now returns commits covering AppDataUpdate proposals as UnresolvedAppDataCommit; the wrapper interprets the (already reference-resolved) proposals and resumes staging via resolve_app_data_commit. The PAUSE-BEFORE-PARSE floor check moves to a pre-processing content_type() check (pause-only, so the unauthenticated signal is safe) with a staged-commit backstop. - New ProcessedMessageContent variants handled: OwnPrivateMessage is a clean skip (replaces the opaque decryption error own fanned-back messages used to produce), OwnPendingCommit and UnresolvedAppDataCommit are defensive errors (unreachable under the pure-ciphertext wire policy / the resolving wrapper). - Proposal::_AppAck arms dropped (variant removed upstream). - cargo-deny: all seven openmls/libcrux advisory allowances removed (RUSTSEC-2026-0124, -0207..-0212) — this bump is the fix they were waiting on — plus stale RUSTSEC-2021-0139 (ansi_term left the graph).
Member
|
@tylerhawkes did you mean to close this? @keks I guess we should still merge this here? |
Contributor
|
Yeah, let's merge this |
tylerhawkes
added a commit
to xmtp/libxmtp
that referenced
this pull request
Jul 23, 2026
…+ GCE dict-immutability fix Moves the openmls pin from e125674 (the pre-merge fork line) to fork main 3fabbf2, which carries the merged upstream (openmls/openmls 65396d8), the replayed fork storage format (xmtp/openmls#56), and the GCE dict-immutability security fix (upstream openmls/openmls#2125, replayed as #56's fifth commit). Ripple effects absorbed here: - extensions-draft-08 -> extensions-draft (upstream #2060 rename), and the 0x004D XWing ciphersuite is now behind draft-ietf-mls-pq-ciphersuites, so that feature is enabled. - tls_codec 0.4.2 -> 0.5 to match openmls: trait impls on openmls types are version-specific. Encode side is byte-identical; the decode side gains strict length-boundary enforcement (rejects non-canonical encodings no conforming encoder produces) plus allocation hardening. - xmtp/hpke-rs fork bumped to the libcrux series hpke-rs 0.7.0 uses so hax-lib unifies at 0.3.7 with the new openmls chain; libxmtp's direct hpke usage stays on the forked 0.6.1 API (0x004D welcome codepoint). - App-data processing ported to upstream's redesigned flow: process_message now returns commits covering AppDataUpdate proposals as UnresolvedAppDataCommit; the wrapper interprets the (already reference-resolved) proposals and resumes staging via resolve_app_data_commit. The PAUSE-BEFORE-PARSE floor check moves to a pre-processing content_type() check (pause-only, so the unauthenticated signal is safe) with a staged-commit backstop. - New ProcessedMessageContent variants handled: OwnPrivateMessage is a clean skip (replaces the opaque decryption error own fanned-back messages used to produce), OwnPendingCommit and UnresolvedAppDataCommit are defensive errors (unreachable under the pure-ciphertext wire policy / the resolving wrapper). - Proposal::_AppAck arms dropped (variant removed upstream). - cargo-deny: all seven openmls/libcrux advisory allowances removed (RUSTSEC-2026-0124, -0207..-0212) — this bump is the fix they were waiting on — plus stale RUSTSEC-2021-0139 (ansi_term left the graph).
tylerhawkes
added a commit
to xmtp/libxmtp
that referenced
this pull request
Jul 23, 2026
…+ GCE dict-immutability fix Moves the openmls pin from e125674 (the pre-merge fork line) to fork main 3fabbf2, which carries the merged upstream (openmls/openmls 65396d8), the replayed fork storage format (xmtp/openmls#56), and the GCE dict-immutability security fix (upstream openmls/openmls#2125, replayed as #56's fifth commit). Ripple effects absorbed here: - extensions-draft-08 -> extensions-draft (upstream #2060 rename), and the 0x004D XWing ciphersuite is now behind draft-ietf-mls-pq-ciphersuites, so that feature is enabled. - tls_codec 0.4.2 -> 0.5 to match openmls: trait impls on openmls types are version-specific. Encode side is byte-identical; the decode side gains strict length-boundary enforcement (rejects non-canonical encodings no conforming encoder produces) plus allocation hardening. - xmtp/hpke-rs fork bumped to the libcrux series hpke-rs 0.7.0 uses so hax-lib unifies at 0.3.7 with the new openmls chain; libxmtp's direct hpke usage stays on the forked 0.6.1 API (0x004D welcome codepoint). - App-data processing ported to upstream's redesigned flow: process_message now returns commits covering AppDataUpdate proposals as UnresolvedAppDataCommit; the wrapper interprets the (already reference-resolved) proposals and resumes staging via resolve_app_data_commit. The PAUSE-BEFORE-PARSE floor check moves to a pre-processing content_type() check (pause-only, so the unauthenticated signal is safe) with a staged-commit backstop. - New ProcessedMessageContent variants handled: OwnPrivateMessage is a clean skip (replaces the opaque decryption error own fanned-back messages used to produce), OwnPendingCommit and UnresolvedAppDataCommit are defensive errors (unreachable under the pure-ciphertext wire policy / the resolving wrapper). - Proposal::_AppAck arms dropped (variant removed upstream). - cargo-deny: all seven openmls/libcrux advisory allowances removed (RUSTSEC-2026-0124, -0207..-0212) — this bump is the fix they were waiting on — plus stale RUSTSEC-2021-0139 (ansi_term left the graph).
tylerhawkes
added a commit
to xmtp/libxmtp
that referenced
this pull request
Jul 24, 2026
…+ GCE dict-immutability fix Moves the openmls pin from e125674 (the pre-merge fork line) to fork main 3fabbf2, which carries the merged upstream (openmls/openmls 65396d8), the replayed fork storage format (xmtp/openmls#56), and the GCE dict-immutability security fix (upstream openmls/openmls#2125, replayed as #56's fifth commit). Ripple effects absorbed here: - extensions-draft-08 -> extensions-draft (upstream #2060 rename), and the 0x004D XWing ciphersuite is now behind draft-ietf-mls-pq-ciphersuites, so that feature is enabled. - tls_codec 0.4.2 -> 0.5 to match openmls: trait impls on openmls types are version-specific. Encode side is byte-identical; the decode side gains strict length-boundary enforcement (rejects non-canonical encodings no conforming encoder produces) plus allocation hardening. - xmtp/hpke-rs fork bumped to the libcrux series hpke-rs 0.7.0 uses so hax-lib unifies at 0.3.7 with the new openmls chain; libxmtp's direct hpke usage stays on the forked 0.6.1 API (0x004D welcome codepoint). - App-data processing ported to upstream's redesigned flow: process_message now returns commits covering AppDataUpdate proposals as UnresolvedAppDataCommit; the wrapper interprets the (already reference-resolved) proposals and resumes staging via resolve_app_data_commit. The PAUSE-BEFORE-PARSE floor check moves to a pre-processing content_type() check (pause-only, so the unauthenticated signal is safe) with a staged-commit backstop. - New ProcessedMessageContent variants handled: OwnPrivateMessage is a clean skip (replaces the opaque decryption error own fanned-back messages used to produce), OwnPendingCommit and UnresolvedAppDataCommit are defensive errors (unreachable under the pure-ciphertext wire policy / the resolving wrapper). - Proposal::_AppAck arms dropped (variant removed upstream). - cargo-deny: all seven openmls/libcrux advisory allowances removed (RUSTSEC-2026-0124, -0207..-0212) — this bump is the fix they were waiting on — plus stale RUSTSEC-2021-0139 (ansi_term left the graph).
tylerhawkes
added a commit
to xmtp/libxmtp
that referenced
this pull request
Jul 25, 2026
…+ GCE dict-immutability fix Moves the openmls pin from e125674 (the pre-merge fork line) to fork main 3fabbf2, which carries the merged upstream (openmls/openmls 65396d8), the replayed fork storage format (xmtp/openmls#56), and the GCE dict-immutability security fix (upstream openmls/openmls#2125, replayed as #56's fifth commit). Ripple effects absorbed here: - extensions-draft-08 -> extensions-draft (upstream #2060 rename), and the 0x004D XWing ciphersuite is now behind draft-ietf-mls-pq-ciphersuites, so that feature is enabled. - tls_codec 0.4.2 -> 0.5 to match openmls: trait impls on openmls types are version-specific. Encode side is byte-identical; the decode side gains strict length-boundary enforcement (rejects non-canonical encodings no conforming encoder produces) plus allocation hardening. - xmtp/hpke-rs fork bumped to the libcrux series hpke-rs 0.7.0 uses so hax-lib unifies at 0.3.7 with the new openmls chain; libxmtp's direct hpke usage stays on the forked 0.6.1 API (0x004D welcome codepoint). - App-data processing ported to upstream's redesigned flow: process_message now returns commits covering AppDataUpdate proposals as UnresolvedAppDataCommit; the wrapper interprets the (already reference-resolved) proposals and resumes staging via resolve_app_data_commit. The PAUSE-BEFORE-PARSE floor check moves to a pre-processing content_type() check (pause-only, so the unauthenticated signal is safe) with a staged-commit backstop. - New ProcessedMessageContent variants handled: OwnPrivateMessage is a clean skip (replaces the opaque decryption error own fanned-back messages used to produce), OwnPendingCommit and UnresolvedAppDataCommit are defensive errors (unreachable under the pure-ciphertext wire policy / the resolving wrapper). - Proposal::_AppAck arms dropped (variant removed upstream). - cargo-deny: all seven openmls/libcrux advisory allowances removed (RUSTSEC-2026-0124, -0207..-0212) — this bump is the fix they were waiting on — plus stale RUSTSEC-2021-0139 (ansi_term left the graph).
tylerhawkes
added a commit
to xmtp/libxmtp
that referenced
this pull request
Jul 25, 2026
…+ GCE dict-immutability fix (#3872) Repins openmls from `e125674` (the pre-merge fork line) to fork main `3fabbf2`: the merged upstream (openmls/openmls `65396d8`), the replayed fork storage format (xmtp/openmls#56), and the GCE dict-immutability security fix (upstream openmls/openmls#2125, carried as #56's fifth commit). This supersedes the earlier revision of this PR, which pinned a pre-merge branch carrying only the GCE fix. ## What the new pin buys - **Persisted storage format restored on fork main** (xmtp/openmls#56): storage tags, the bincode-safe `PastEpochDeletionPolicy` encoding, and tolerant trailing-field deserialization — data written by libxmtp 1.9/1.10 (pre-`added_at`, `max_past_epochs`) and 1.11-dev loads unchanged. Guarded by bincode round-trip and EOF-tolerance tests fork-side. - **GCE dict-immutability**: a bare `GroupContextExtensions` proposal can no longer rewrite `app_data_dictionary` directly. - **cargo-deny cleanup**: all seven openmls/libcrux advisory allowances removed (RUSTSEC-2026-0124, -0207 through -0212 — this bump is the fix they were waiting on), plus stale RUSTSEC-2021-0139 (`ansi_term` left the dependency graph). `cargo deny check advisories` passes. ## Ripple effects absorbed - **Feature renames**: `extensions-draft-08` → `extensions-draft` (upstream #2060); the 0x004D XWing ciphersuite moved behind `draft-ietf-mls-pq-ciphersuites`, now enabled. - **tls_codec 0.4.2 → 0.5** to match openmls (trait impls on openmls types are version-specific). Encode side is byte-identical; decode side gains strict length-boundary enforcement — it rejects only non-canonical encodings that no conforming encoder produces — plus allocation/overflow hardening. The hpke-rs 0.6.1 fork keeps its own 0.4.2 internally; the versions never exchange types. - **xmtp/hpke-rs fork libcrux bump**: the fork's libcrux deps move to the series upstream hpke-rs 0.7.0 uses, so `hax-lib` unifies at 0.3.7 with the new openmls chain. The forked 0.6.1 API (and the 0x004D obsolete-XWing welcome codepoint for 1.9/1.10 wire compat) is unchanged; all 9 XWing draft-06 suites pass fork-side. - **App-data processing ported to upstream's redesigned flow**: `unprotect_message` + `process_unverified_message_with_app_data_updates` are gone; `process_message` now returns commits covering `AppDataUpdate` proposals as `UnresolvedAppDataCommit`, and the wrapper interprets the (already reference-resolved) proposals and resumes staging via `resolve_app_data_commit`. The PAUSE-BEFORE-PARSE floor check moves ahead of processing, keyed off the framing `content_type()` — safe because the check only ever pauses a group whose committed floor already exceeds this client — with a staged-commit backstop. The manual by-reference proposal resolution block is deleted (upstream resolves references itself). - **New `ProcessedMessageContent` variants**: `OwnPrivateMessage` (own fanned-back message with no matching intent) is a clean skip that still advances the cursor — replacing the opaque decryption error it used to produce; `OwnPendingCommit` and `UnresolvedAppDataCommit` are defensive errors (the former is unreachable under our pure-ciphertext wire policy, the latter never escapes the wrapper). - `Proposal::_AppAck` match arms dropped (variant removed upstream); `non_retryable_error_increments_cursor` renamed to `own_message_without_intent_skips_and_increments_cursor` to match the typed skip it now exercises. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
validate_app_data_update_proposals_and_group_contextenforcesdraft-ietf-mls-extensions §4.7-6:
once a group's
required_capabilitiesinclude theAppDataUpdateproposal type,a
GroupContextExtensionsproposal MUST NOT add, remove, or modify theapp_data_dictionaryextension.Today that check sits after an early return:
So the rule is only enforced when the commit also carries at least one
AppDataUpdateproposal. A bareGroupContextExtensionsproposal — one withno accompanying
AppDataUpdateproposals — skips the check entirely and canrewrite
app_data_dictionarydirectly, bypassing theAppDataUpdatemachinery(and any application-level validation layered on it). On a group whose members
all support
AppDataUpdate, any member can thereby overwrite arbitrarycomponents of the dictionary.
Fix
Hoist the dictionary-immutability check above the early return, so it binds
every commit that carries a
GroupContextExtensionsproposal regardless ofwhether
AppDataUpdateproposals accompany it.The rule is treated as active when the group requires
AppDataUpdatebefore orafter the commit:
required_capabilitieswould let a sender evadethe check by dropping
AppDataUpdatefromrequired_capabilitiesin the sameproposal.
required_capabilitieswould incorrectly flag themigrating commit that both introduces the dictionary and adds
AppDataUpdate.The ordering and duplicate-
AppDataUpdatechecks remain after the early return,where they belong (they are only meaningful when
AppDataUpdateproposals arepresent).
Tests
Adds
test_group_context_update_dictionary_without_app_data_update: a bareGroupContextExtensionsproposal that touches the dictionary with noaccompanying
AppDataUpdateproposal must be rejected withCannotUpdateDictionaryDirectly. The three existing tests inapp_data_update_proposal_validation.rs(update_dictionary,wrong_order,after_deactivating) are unaffected —validate_group_context_extensions_proposalruns first, so the
ExtensionNotInRequiredCapabilitiespath is preserved.Runs under
--features extensions-draft,extensions-draft-test-dependencies.