Skip to content

[Security]: session JSON artifacts are written world-readable on unix (0o644 default umask) #2605

Description

@1688mengdie

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 32f2427 (origin/main); reproducible on any unix host with default umask (verified by code-path analysis; unix CI matrix exercises the fixed behavior).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions