Repository navigation
fix(id): redact install seed from join projections - #250
Merged
Merged
Conversation
ProgramInstalled { seed } was serialized to every joiner through
WorldCore::events_after and the join snapshot, so a program whose
hidden state derives from init(seed) leaked that state to every
participant.
Per the recommendation on #240, treat the seed as secret: add
redact_install_seed and apply it in the two join projections
(snapshot_unchecked and events_after). Joiners keep the module hash
(they need it to fetch the module) but see seed 0. The journal, the
core's retained events, RestoredProgram and the install/admin return
path keep the real seed, so replay through the journal/admin path is
unchanged.
Regression test: restore a journal whose install used seed 424242,
assert the restore/core keep it and that neither events_after nor the
snapshot exposes it.
|
Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configuration
📒 Files selected for processing: 1
✨ Finishing Touches
Comment |
This was referenced Oct 18, 2026
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.
Fixes #240.
Problem
ProgramInstalled { seed }was serialized to every joiner:WorldCore::events_afterand the join snapshot (snapshot_unchecked) returned the retained event verbatim (verified: seed424242in fixture work on PR #239, and reproduced here with a new regression test that failed on main). A program whose hidden state is derived frominit(seed)therefore leaked that state to every participant.Solution (the issue's recommended option: treat the seed as secret)
redact_install_seedprojection inworld.rs: aProgramInstalledevent keeps itsmodule_hash(joiners need it to fetch the module viaDownloadModule) but itsseedis zeroed.WorldCore::events_afterandWorldCore::snapshot_unchecked(which also covers the session snapshot/resnapshot paths and the lagged-subscriber resync, all of which go throughsnapshot/events_afterwith a JOIN capability).JournalEntry::Committed/Checkpoint), the core's retained events,RestoredProgram,active_seed, and theinstall_programreturn to the admin — replay through the journal/admin path still uses the real seed the admin installed with. The live broadcast path already never forwardsProgramInstalleditself (it sends a fresh snapshot +ProgramChanged { module_hash }).Tests
join_projections_redact_the_install_seed_but_the_journal_keeps_it: failed before the fix (seed 424242 inevents_after), passes after; also asserts the journal restore path and core keep the real seed.cargo test --lib -- world:: world_session:: world_store:: world_hub::— 122 passed, 0 failed.cargo check --lib --no-default-features— passes (one pre-existing dead-code warning in event_store/ingest.rs, unrelated).