[Security]: session JSON artifacts are written world-readable on unix (0o644 default umask)
- Vorherrschende Sprache
- Rust
- Sterne
- 2.3k
- Forks
- 231
- Ø Merge
- 2 Std. 46 Min.
- Gemergte PRs (30 T.)
- 577
Beschreibung
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).
Beitragsleitfaden
Rechercherichtung
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.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- rust
- Bereich
- backend, security
- Issue-Typ
- Bug
- Schwierigkeit
- 2/5
- Geschätzter Aufwand
- 1-3 Stunden
- Aktivitätsstatus
- Aktiv
- Klarheit
- Klar beschrieben
- Anfängerfreundlichkeit
- 78/100