Skip to content

Commit e93b88a

Browse files
npub1mn7jgtj4w2pd0g0zeuhxsa6jy6p0rewxz4kujt98my82ahfmp72sxjexk7wpfleger96
andcommitted
docs(security): document E2E gate None-arm and get_nsec key-scope caveat
Two comment-only fixes from Thufir's security review of PR #1185: - ingest.rs: add explicit comment on the channel_id == None arm of the E2E latch gate explaining why the silent skip is safe (channel-less events cannot be latched; rejected downstream at insert). - lib.rs: add comment near get_nsec registration scoping the 'private key never leaves Rust' property to the nip44_encrypt/decrypt commands and noting get_nsec as a tracked follow-on hardening item. - check-file-sizes.mjs: bump lib.rs ceiling (1034 → 1044, +8 comment lines) and tauri.ts ceiling (1218 → 1231, main grew since rebase). Co-authored-by: Will Pfleger <pfleger.will@gmail.com> Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
1 parent 3992732 commit e93b88a

3 files changed

Lines changed: 17 additions & 4 deletions

File tree

crates/buzz-relay/src/handlers/ingest.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1536,6 +1536,10 @@ pub async fn ingest_event(
15361536
}
15371537
}
15381538
}
1539+
// channel_id == None: channel-less events cannot be latched (the latch is
1540+
// set at create_dm time and keyed to a channel row). A channel-scoped kind
1541+
// with no `h` tag is rejected downstream at insert regardless, so skipping
1542+
// the latch check here is safe. The explicit arm keeps this intentional.
15391543
}
15401544

15411545
// Track pre-created channel UUID for compensation on insert failure.

desktop/scripts/check-file-sizes.mjs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,9 @@ const overrides = new Map([
6262
// threaded through Tauri invokes for configurable repos_dir, plus the
6363
// harness-persona-sync `harnessOverride` create-input bit — load-bearing
6464
// parameter plumbing, not generic debt growth. E2E DM crypto wiring adds
65-
// further plumbing here; ceiling holds both. Approved override; still
65+
// further plumbing here; ceiling holds all. Approved override; still
6666
// queued to split.
67-
["src/shared/api/tauri.ts", 1218],
67+
["src/shared/api/tauri.ts", 1231],
6868
// harness-persona-sync feature growth, queued to split in the resolver-unify
6969
// refactor followup. discovery.rs is dominated by the new test module
7070
// (the effective_agent_command / divergent / create-time override matrix);
@@ -83,8 +83,9 @@ const overrides = new Map([
8383
// persona-events rebase: boot-time event-sync wiring (run_boot_migrations
8484
// syncs team-dir edits before all personas.json readers; run_event_sync
8585
// signs the persona/team retention events post-identity) layered on top of
86-
// main's growth. Load-bearing feature growth, queued to split with the list.
87-
["src-tauri/src/lib.rs", 1034],
86+
// main's growth. E2E DM review fix adds a scoping comment near `get_nsec`
87+
// (8 lines, load-bearing security documentation). Queued to split.
88+
["src-tauri/src/lib.rs", 1044],
8889
// onMarkRead + isUnread prop threading (mirrors the onMarkUnread prop
8990
// already here) for the single-toggle mark-read/unread menu item — a small
9091
// overage from load-bearing per-message plumbing, not generic debt growth.

desktop/src-tauri/src/lib.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -748,6 +748,14 @@ pub fn run() {
748748
})
749749
.invoke_handler(tauri::generate_handler![
750750
get_identity,
751+
// NOTE: `get_nsec` returns the raw bech32 private key to any frontend
752+
// caller. The "private key never leaves Rust" property stated in the
753+
// NIP-44 DM command design applies to the `nip44_encrypt_to_peer` /
754+
// `nip44_decrypt_from_peer` API boundary — those commands accept
755+
// plaintext/ciphertext and return only the result. `get_nsec` is a
756+
// separate, pre-existing escape hatch used by identity import/export
757+
// flows. Removing or access-gating `get_nsec` is tracked as a
758+
// follow-on hardening item.
751759
get_nsec,
752760
import_identity,
753761
get_profile,

0 commit comments

Comments
 (0)