[Security]: session JSON artifacts are written world-readable on unix (0o644 default umask)
- Dominant language
- Rust
- Stars
- 2.2k
- Forks
- 229
- Avg merge
- 2h 46m
- Merged PRs (30d)
- 577
Description
Summary: On unix, session JSON artifacts written through JsonFileStore (session transcripts, metadata, token usage) are published with permissions inherited from the process umask — typically 0o644 — making prompt/output content world-readable on multi-user hosts.
Area: Agent runtime / core
Reproduction or evidence: `src/crates/services/services-core/src/json_store.rs:306` writes the payload to a temp file (`fs::write`) and renames it into place without any permission tightening; the file contains no `set_permissions`/`PermissionsExt`/`0o600` logic anywhere. On a unix host with default umask 022, the published artifact is world-readable (`-rw-r--r--`).
Environment: BitFun version/commit 32f2427697ee16f253ee6119860a03255c0b3e47 (origin/main); reproducible on any unix host with default umask (verified by code-path analysis; unix CI matrix exercises the fixed behavior).
Contributor guide
Research direction
Start at src/crates/services/services-core/src/json_store.rs:306 and trace how JsonFileStore writes and renames session artifacts on Unix. Verify the resulting file mode under a 0o22 umask, then confirm completion when session JSON files are not world-readable and the Unix checks pass.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- backend, security
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 78/100