Decentralized social media network — no central server, user-owned data
Find a file
Scott Reimers 4ec3a80b6c fix(fof): key-burn replay rejection + bounded sweep lock-hold
Two security/operational findings from the deeper pre-deploy audit:

1. Key-burn replay attack (security)
   - Before: replace_fof_slot did a blind UPDATE on receive. An
     attacker replaying an older signed FoFKeyBurn diff (Monday's)
     after a newer one (Friday's) would revert the slot.
   - Fix: new fof_key_burns table tracks (post_id, slot_index) ->
     max(burned_at_ms) seen. replace_fof_slot now refuses to apply
     a burn whose timestamp is <= the stored max. Atomic transaction
     ensures the gating-update + monotonic-record stay consistent.
   - apply_fof_key_burn_locally signature gains burned_at_ms; the
     three callers (connection.rs receive, node.rs author API, the
     fof.rs roundtrip test) all updated.

2. Unbounded sweep lock-hold (operational)
   - Before: sweep_unreadable_on_new_v_x walked up to 4096 queued
     posts per call, all under one storage lock. ~2s lock-held worst
     case. Attack: spammy bio posts trigger repeated sweeps.
   - Fix: MAX_SWEEP_PER_CALL = 256. Remaining entries processed on
     subsequent V_x arrivals. Bounds lock-hold to ~250ms worst case.

One new test (158 total):
- fof_key_burn_replay_rejected: applies Monday burn, then Friday
  burn, then replays Monday — asserts stored state stays at Friday's
  pub_x.

Bio-post replay was also evaluated: vouch grants are HPKE-sealed
(unforgeable) and stored INSERT OR IGNORE on (holder, owner, epoch)
so replay is a no-op. No fix needed.

Revocation + access-grant were also evaluated as idempotent by their
storage layers (INSERT OR IGNORE / dedup-on-pub_x). Safe.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-14 20:31:15 -06:00
crates fix(fof): key-burn replay rejection + bounded sweep lock-hold 2026-05-14 20:31:15 -06:00
deploy ItsGoin v0.3.2 — Decentralized social media network 2026-03-15 20:23:09 -04:00
docs docs: spec cleanup — Layer 5 wording, Layer 3 banner, Layer 6 superseded 2026-05-13 01:10:43 -04:00
frontend feat(fof-layer4): Tauri commands + Settings "Rotate my vouch key" UI 2026-05-14 19:18:31 -06:00
website docs(design.html): add section 20a Friend-of-Friend Visibility 2026-05-13 01:20:43 -04:00
.gitignore Add build-appimage.sh and deploy.sh automation scripts 2026-04-19 16:01:34 -04:00
.sync-exclude.lst ItsGoin v0.3.2 — Decentralized social media network 2026-03-15 20:23:09 -04:00
AGENTS.md Adopt multi-contributor git workflow (CONTRIBUTING.md + AGENTS.md + sessions.md) 2026-04-23 20:07:54 -04:00
ARCHITECTURE.md ItsGoin v0.3.2 — Decentralized social media network 2026-03-15 20:23:09 -04:00
build-appimage.sh Add build-appimage.sh and deploy.sh automation scripts 2026-04-19 16:01:34 -04:00
Cargo.lock v0.6.2 release: version bump + changelog 2026-04-22 23:54:40 -04:00
Cargo.toml ItsGoin v0.3.2 — Decentralized social media network 2026-03-15 20:23:09 -04:00
CONTRIBUTING.md Adopt multi-contributor git workflow (CONTRIBUTING.md + AGENTS.md + sessions.md) 2026-04-23 20:07:54 -04:00
deploy.sh Network-wide announcements signed by the bootstrap anchor posting id 2026-04-23 01:50:12 -04:00
download-page.html ItsGoin v0.3.2 — Decentralized social media network 2026-03-15 20:23:09 -04:00
IMPLEMENTATION_PLAN_0.6.md Implementation plan: drop cross-version compat, beta/stable as separate networks 2026-04-21 18:26:55 -04:00
pic2.png v0.4.4: UI overhaul — sticky header, mobile nav, profiles/redundancy lightboxes 2026-03-23 00:56:27 -04:00
project discussion.txt ItsGoin v0.3.2 — Decentralized social media network 2026-03-15 20:23:09 -04:00
project-notes-from-elitebook.md ItsGoin v0.3.2 — Decentralized social media network 2026-03-15 20:23:09 -04:00
sessions.md docs(design.html): add section 20a Friend-of-Friend Visibility 2026-05-13 01:20:43 -04:00
TODO.md ItsGoin v0.3.2 — Decentralized social media network 2026-03-15 20:23:09 -04:00