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
Found by the 2026-10-21 security review (SECURITY-REVIEW-2026-10-21.md, finding F4). Reproduced on main286d2ba.
appendLog in src/logfmt.ts is read-modify-write with an await between read and write. Probe: 20 concurrent appendLog calls to one file → 2 survived.
Impact: lost rows under any concurrency — interleaved async hooks in the service, and service vs. viewer (separate processes). Same failure family as the 2026-10-20 undo-clobber incident: conflict-aware restore fixed the restore side; the append side still races. Every memory and evidence append goes through this function.
Fix direction (P0): single write via Bun's append mode (O_APPEND, atomic for small POSIX writes) instead of existing + next; keep read-modify-write only for in-place edits. Test: 50 concurrent appends must all be present. (Residual: in-place supersede rewrites racing appends needs a lockfile — tracked separately.)
Activity
Merge pull request #25 from abogartz/fix/atomic-append
chore(release): 0.3.4 [skip ci]
fix(store): one O_APPEND write per append — concurrent appends no lon…
Merge origin/main into fix/logfmt-legacy-escapes