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
mcp: the token document's mode check never compares its owner to the daemon's euid #1315
Found by job 045's security lens (row 5 of #868) at 8488bf13.
checked judges type, permission bits and size only (crates/nostream-mcp/src/credential.rs:273-292); the refusal text claims "no one but its owner can read or rewrite it", but the owner it names is never compared to the process. The file form re-reads the document on every call, so the grant is live: an owner other than the daemon's euid can rewrite {"scopes":["write"]} between a read call and a write call. The exposure needs a root-run --mcp-stdio pointed at a file another user owns (a non-root daemon cannot open a foreign 0600 file at all, which is the fail-closed half), so it is low rather than high.
Compare the document's owner (MetadataExt::uid) to the effective uid and refuse a foreign-owned document, which also makes the refusal text true. The code comment calls this a shortcut that "needs a dependency this crate was not given" (crates/nostream-mcp/src/credential.rs:218-221); std::os::unix::fs::MetadataExt supplies it without a new dependency.
Acceptance
A case creates a 0600 document owned by another uid and asserts the refusal.
The refusal text and the check agree, or the text is narrowed to what is checked.
Record: docs/rewrite/reviews/2026-11-30-relay-storage.md — finding F19, lens security, tree 8488bf13.
Activity