You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Crash recovery restores a shared config with a journal copy's unverified permissions #5111
bugLegacy classification name; prefer type/bug. Retained while discovery consumers are migrated.status/acceptedHuman scope approval; verify the issue's approval record and review contact before work.type/bugSomething does not work as documented.
Crash recovery for shared config files (#5009, #5016) authenticates the journal copy's bytes: its digest must equal the owner-backed prior digest in this machine's config file records. Replay then restores the copy with shutil.copystat, which also restores the copy's permission bits. Those bits are not bound to any owner-backed evidence.
If the journal copy's mode is changed (for example from 0600 to 0666) while its bytes stay the same, both digests still match. A restored MCP config can then be world-readable, which can expose credentials. Changing the copy needs write access to the user's ~/.apm/install-snapshots.
Done when
The records (or the journal's sealed state) bind the pre-write mode of a shared config file, and replay checks it before restoring. A mismatch is kept and reported, or restored with the recorded mode.
A permission-only tampering cell: the copy's mode is widened and its bytes are unchanged; the restored file never gets the widened mode.
Out of scope
Content verification (already owner-backed) and the deletion decision.
Decision: approve
Area: project
Scope: Shared-config crash recovery (#5009/#5016; #5105 class) binds and checks permission bits. The owner-backed config file records (or the journal's sealed state) carry the pre-write mode of a shared config file, and replay checks it before restoring. On a mismatch, or when the mode cannot be verified, replay restores with the recorded mode if it verifies, and otherwise keeps the current file and reports (fail closed). A restore never applies the journal copy's own unverified mode bits and never widens a file's permissions. The #5009 content rule is unchanged (journal hash AND record verify). The only new persisted field is the mode, inside the existing record.
Done when: A red-first permission-only tampering cell widens the copy's mode (0600 to 0666) with unchanged bytes and asserts that the restored file never gets the widened mode. A cell with a matching mode restores as today. Downgrade safety: an older apm reading a record with the mode field fails closed or ignores it, and never widens permissions. W3d, then QL H8. A CHANGELOG fragment and CI green.
Out of scope: Content verification (already owner-backed) and the deletion decision.
Review contact: Daniel Meppiel (@danielmeppiel)
bugLegacy classification name; prefer type/bug. Retained while discovery consumers are migrated.status/acceptedHuman scope approval; verify the issue's approval record and review contact before work.type/bugSomething does not work as documented.
Activity
danielmeppiel commentedon Nov 23, 2026
Decision: approve
Area: project
Scope: Shared-config crash recovery (#5009/#5016; #5105 class) binds and checks permission bits. The owner-backed config file records (or the journal's sealed state) carry the pre-write mode of a shared config file, and replay checks it before restoring. On a mismatch, or when the mode cannot be verified, replay restores with the recorded mode if it verifies, and otherwise keeps the current file and reports (fail closed). A restore never applies the journal copy's own unverified mode bits and never widens a file's permissions. The #5009 content rule is unchanged (journal hash AND record verify). The only new persisted field is the mode, inside the existing record.
Done when: A red-first permission-only tampering cell widens the copy's mode (0600 to 0666) with unchanged bytes and asserts that the restored file never gets the widened mode. A cell with a matching mode restores as today. Downgrade safety: an older apm reading a record with the mode field fails closed or ignores it, and never widens permissions. W3d, then QL H8. A CHANGELOG fragment and CI green.
Out of scope: Content verification (already owner-backed) and the deletion decision.
Review contact: Daniel Meppiel (@danielmeppiel)
fix(install): replay restores the recorded mode, never a journal copy…
fix(install): replay decides keep-or-restore on the recorded mode (#5111
fix(install): apply a restored directory's own mode without following…
test(install): red-first cells for journal versions and special mode …
fix(install): journals that record modes are format version 2; specia…
refactor(install): import the journal mode helpers as one module (#5111)
docs(changelog): state the upgrade action for journals left by an ear…
docs(changelog): describe the one-time exit for an earlier apm's jour…
docs(install): describe replay of a journal left by an earlier apm (#…
docs(install): say where to find the paths of a journal left by an ea…
Merge pull request #5117 from microsoft/cloud-5111-replay-mode
test(install): red-first cells for journal copy modes on replay (micr…