Skip to content

Store dirs and files are created with the process umask - durable memory is group/world-readable #218

Closed

Description

@abogartz

Finding

The memory store inherits the process umask. ensureDir (src/logfmt.ts:80-82) is the only directory creator and passes no mode; the single append path (src/logfmt.ts:96) and the whole-file-rewrite temp file (src/logfmt.ts:133) also pass none. With the usual umask 0022, the live store reads: store directory drwxr-xr-x; day files, deletions.logfmt and snapshot files -rw-r--r--.

Any local process running as another uid can read the full durable history (session IDs, repository identifiers, open planning threads, transcript fragments) and forge rows. This is the plugin's only confidentiality boundary: the viewer's loopback default protects a port, not the data at rest.

Fix direction

One helper in src/logfmt.ts: mkdir(path, { recursive: true, mode: 0o700 }) with chmod on each created segment (the recursive flag applies modes only to newly created leaves on some platforms), 0o600 for day files, snapshots and the deletion log, and root hardening when the store directory is first resolved. src/portable.ts:124,130 already implements exactly this pattern for export bundles, and test/containment.test.ts:368,383 already tests the property there, so the test shape copies over.

Source

Architecture review 2026-10-31, finding S1 (High); confirmed in the 2026-11-01 synthesis. Reproduced against a throwaway store; the live store was only read.

Activity

  1. added
    bug
    store-security
    severity:high
    on Nov 1, 2026
  2. WhollyMindless commented on Nov 1, 2026

    @WhollyMindless
    Contributor

    Taking #218. I will cover owner-only POSIX permissions at directory creation, append, atomic replacement, and snapshot creation; check existing-store handling without changing unrelated parent directories; and add Linux/WSL regressions plus the Windows gate. Windows ACLs will remain an explicit separate platform limitation. I found no existing claim or overlapping PR.

  3. WhollyMindless commented on Nov 1, 2026

    @WhollyMindless
    Contributor

    Implemented in #244 (6cdec42). Local Windows gate and Linux/WSL unit suite are green; hosted CI/review pending. The PR spells out existing-store handling, the symlinked-root compatibility change, and the unchanged Windows ACL boundary. Please feel free to request changes or defer it.

  4. abogartz-opencode-self-improvement commented on Nov 2, 2026

    @abogartz-opencode-self-improvement

    🎉 This issue has been resolved in version 0.15.6 🎉

    The release is available on:

    Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugreleasedseverity:highstore-security

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions