PCH-02-003-sas-trust-model-comment.patch.md

3.4 KB · raw

rendered · source

1# PCH-02-003 — Document the SAS peer-gate trust-model dependency (doc-only)23**Severity:** Informational4**Target file:** `src/shared/chirp-handshake.ts:125-154` (the SECURITY block)5**Report:** peach-code-review.md, Finding PCH-02-00367## Decision89Documentation only — no code change. The review itself calls the existing10comment "one of the better in-code threat statements in the codebase"; the11brief asks for the finding ID, the Android source pointer, and the explicit12"documented residual risk" framing to be added. The existing text is kept —13three surgical insertions rather than a rewrite, so the PCH-01-024 history in14the block stays intact.1516## Exact edits1718Edit 1 — tag the block with the finding ID (line 126):1920```typescript21// BEFORE22// SECURITY — TRUST MODEL: the pairing handshake does NOT cryptographically2324// AFTER25// SECURITY — TRUST MODEL (PCH-02-003): the pairing handshake does NOT cryptographically26```2728Edit 2 — add the repository pointer to the OPEN ITEM paragraph (lines 146-149):2930```typescript31// BEFORE32// OPEN ITEM (NOT verifiable from this repository): the Android/native client33// MUST surface and enforce the identical SAS gate before it persists the peer.34// If the app skips or auto-confirms the SAS, the channel is only as strong as35// the app's weakest end — confirm the app-side gate against the Android source.3637// AFTER38// OPEN ITEM (NOT verifiable from this repository): the Android/native client39// MUST surface and enforce the identical SAS gate before it persists the peer.40// If the app skips or auto-confirms the SAS, the channel is only as strong as41// the app's weakest end — confirm the app-side gate against the Android source42// at kepr.uk/peach-android (verify the Noise NK SAS enforcement before any43// device is persisted). A MITM who intercepts the acoustic chirp and completes44// the handshake against a non-enforcing peer can pair without user awareness.45```4647Edit 3 — close the block with the residual-risk framing (after line 153,48before the closing rule):4950```typescript51// BEFORE52// (noise-js) so each side proves possession of the key it advertises, making53// authentication structural rather than dependent on the user's SAS comparison.54// ───────────────────────────────────────────────────────────────────────────5556// AFTER57// (noise-js) so each side proves possession of the key it advertises, making58// authentication structural rather than dependent on the user's SAS comparison.59//60// This is documented residual risk in the cross-repo trust model, not a bug in61// this codebase: control (1) — the extension-side gateOnSAS — is enforced here62// (chirp-pair.ts) and regression-tested (PCH-01-024); control (2) — the peer-63// side gate — lives in the Android repository and must be re-verified there on64// every Android release that touches pairing.65// ───────────────────────────────────────────────────────────────────────────66```6768No tests — comment-only change; the existing `gateOnSAS` regression test69(added in PCH-01-024) already pins the extension-side control.7071## Save message (integration)7273`docs: PCH-02-003 document SAS peer-gate trust model dependency with Android source reference`