11f364bd4e84
docs: Refresh SYN-001 status
- time
- 2026-04-30 13:38 UTC · 6 months ago
- machine
- koh2
- parent
- ee019ea00094
↓ peach-browser-11f364bd.tar.gzatlas at this save
files changed1 file
syn001.md+38 −66syn001.md+38 −66
@@ -2,80 +2,52 @@22 33 ## Summary44 5-SYN-001 is the Peach Sync blocker.5+SYN-001 is the Peach Sync blocker that kept desktop native sync dormant.66 7-Peach Sync's native Rust host uses Noise NK for peer authentication, but the8-responder side currently creates its static private key with an all-zero9-placeholder:7+The original bug was that the Rust native host used an all-zero Noise NK static8+private key on the responder path. That made every install present the same9+responder identity, which defeats the peer-authentication property sync relies10+on.1011 11-- `native/peach-sync-host/src/tcp.rs`12-- Marker: `NoiseBridge::new_responder(&[0u8; 32])`12+That original all-zero-key bug has been fixed in the SYN-001 sprint. The host13+now has a persisted per-install X25519 identity, advertises only the public key,14+uses the real identity in responder and initiator Noise paths, and has Rust tests15+for real-key handshakes and wrong-public-key rejection.1316 14-That means every Peach install would present the same responder identity.15-Noise NK depends on the responder static key being real and device-specific, so16-with `[0u8; 32]` authentication is effectively broken and impersonation becomes17-trivial.17+## Completed So Far1818 19-## Why It Matters19+- Phase 0 baseline captured before implementation: version `2.13.2`, Koh head20+ `636a946976ec`, and initial `cargo check` failure summary.21+- Compile-only native-host baseline saved as `4b36429b213d`22+ (`chore: Prepare native host compile baseline (v2.13.3)`).23+- First sync security behavior change saved separately as `b49712298cc7`24+ (`fix: Replace sync host static Noise identity (v2.13.4)`).25+- Trusted-device store, identity rotation, and authentication proof layer added.26+- Browser native-messaging framing added to the Rust host.27+- Dormant TypeScript client aligned with the Rust host protocol.28+- mDNS discovery events now flow back through the native-messaging output loop.2029 21-Sync is a high-trust path. It can move encrypted vault state between devices and22-depends on device identity being meaningful.30+## Current Safety Gate2331 24-If every responder uses the same static private key:32+The risky path is still not shipped:2533 26-- a peer cannot reliably authenticate that it is talking to the intended Peach27- device;28-- any attacker who knows the placeholder identity can impersonate a responder;29-- mDNS discovery and local-network transport become dangerous to enable;30-- re-adding `nativeMessaging` would expose a high-risk extension permission for31- a path that is not safe yet.32-33-## Why It Has Not Been Resolved Yet34-35-It is not just a one-line replacement. A proper fix needs a small dedicated36-sync sprint:37-38-1. Make `native/peach-sync-host` compile cleanly.39-2. Generate a per-install X25519 keypair.40-3. Persist the private key in the appropriate platform store or a clearly41- scoped native-host config file.42-4. Advertise only the public key through mDNS.43-5. Bind pairing and trusted-device records to the real public key.44-6. Define key rotation and recovery behavior.45-7. Add handshake tests for distinct identities, impersonation rejection, and46- paired-device acceptance.47-8. Re-audit the native host before re-enabling any live code path.48-49-Current project rules keep sync dormant until that work is done:50-51-- `.agent/Projects.md` says `nativeMessaging` must not be re-added until52- SYN-001 is fully resolved.53-- `.agent/Projects.md` also says not to wire any code path to54- `connectSyncHost()` and not to touch `native/` except in a dedicated SYN-00155- fix sprint.56-- `src/background/sync.ts` is marked dormant and says not to import or re-enable57- sync without completing the SYN-001 fix sprint and full native-host re-audit.58-59-## Current State60-61-The risky path is not shipped:62-6334 - neither browser manifest includes `nativeMessaging`;64-- no live code path calls `connectSyncHost()`;65-- the Android wiring work intentionally did not enable sync or mDNS;66-- the native host still needs compile fixes and a security pass before use.35+- no live background handler imports or calls `connectSyncHost()`;36+- `src/background/sync.ts` is gated and documents that sync remains disabled37+ until the audit/gate checklist passes;38+- Android sync remains deferred to the later WebSocket/Capacitor phase.6739 68-## Suggested Fix Plan40+## Remaining Before Re-Enabling6941 70-Treat SYN-001 as its own unit of work:42+1. Finish the native-host audit checklist: private-key handling/logging,43+ identity file permissions, mDNS TXT contents, random-port behavior,44+ trusted-device lifecycle, pairing flow, error surfaces, and rate limits.45+2. Build the real sync payload flow: length-prefixed encrypted JSON messages,46+ vault manifest/diff exchange, merge rules, locked-vault cancellation, and47+ Pro/background gates.48+3. Add native-host installer manifest generation and only then add49+ `nativeMessaging` to the browser manifests.50+4. Add manual E2E coverage with two desktop installs before marking SYN-00151+ resolved.7152 72-1. Create a Koh checkpoint before touching `native/`.73-2. Fix the native host compile errors without changing protocol behavior.74-3. Add persisted per-install Noise identity.75-4. Wire the identity into advertise, discover, connect, and accept paths.76-5. Add Rust tests around key generation, persistence, handshake success, and77- impersonation failure.78-6. Add extension-side tests for sync gating.79-7. Re-enable `nativeMessaging` only after the audit passes.80-81-Until then, sync should remain dormant.53+Until those are complete, sync should remain gated and dormant.