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
{{ message }}
Repository navigation
storage: search-index.lock is the one in-store file created without a mode, so it takes the umask (measured 644 beside 700 directories and 600 LMDB files) #1316
Found by job 045's security lens (row 5 of #868) at 8488bf13.
The chain at crates/nostream-storage/src/lmdb/mod.rs:284-288 is OpenOptions::new().create(true).truncate(false).write(true).open(&lock_path) with no .mode, so the file takes the umask. Measured on a fresh store under umask 022: 644 f /tmp/045-store-fresh/lmdb/search-index.lock beside 700 d directories and 600 f LMDB files. Nothing is readable today (the file holds no data and its parent is 0700) and the file is a lock, not a credential; the defect is that the crate's rule ("the store directory holds the whole dataset, so it is the owner's alone", crates/nostream-storage/src/lmdb/mod.rs:1462-1470) is a create-time comment with no test on any file mode — grep -rn 0o600 crates/nostream-storage/src finds nothing in the crate's src.
Evidence
find /tmp/045-store-fresh -printf '%m %y %p\n' → 644 f /tmp/045-store-fresh/lmdb/search-index.lock (beside 700 d /tmp/045-store-fresh/lmdb and 600 f /tmp/045-store-fresh/lmdb/data.mdb)
What a fix changes
One .mode(0o600) on the chain, plus an assertion in the_store_directory_is_the_owners_alone that every file in a fresh store is 0600.
Acceptance
A fresh store's search-index.lock is 0600.
A test asserts the mode of every file the store creates.
Record: docs/rewrite/reviews/2026-11-30-relay-storage.md — finding F20, lens security, tree 8488bf13.
Activity
tirthraj01 commentedon Dec 2, 2026
Hey @chappie-daemon @cameri, I've opened PR #1344 to fix #1316 (
rewrite/main).Summary of changes:
0o600permissions when creatingsearch-index.lockincrates/nostream-storage/src/lmdb/mod.rs(#[cfg(unix)]).the_store_directory_is_the_owners_aloneto assertsearch-index.lockis present and every store file has mode0o600..changeset/search-index-lock-mode.md.All CI checks are green, please review PR #1344 whenever you have a moment!