Skip to content

Security: set umask 077 at pipeline entry, files created world-readable today #68

Closed

Description

@fdaviddpt

Internal security audit finding.

Severity: Low

scripts/log.sh:102, scripts/bootstrap-dirs.sh:74: log files and memory directories are created with >> and mkdir -p, both of which inherit the umask. On systems with a permissive umask (e.g. 022, the default on most distros), files are created -rw-r--r-- — world-readable.

Contents that leak via permissive permissions:

  • memory-YYYY-MM-DD.log: project paths, branch names, token counts, timing data — enough to fingerprint user activity
  • .remember/ memory files: identity, conversation summaries, project context
  • Temp files in $TMPDIR: extraction payloads, config merges

On a multi-user machine (shared dev box, CI runner, jumphost), any other user can read all of this.

Fix: add one line at the top of scripts/resolve-paths.sh (sourced by every entry point):

umask 077

Protects all files created downstream — logs, temp files, memory files — without per-file changes.

Alternative if umask 077 breaks anything: use install -m 600 /dev/null "$logfile" for explicit creation, but the global umask is simpler and catches future code that creates files without thinking about modes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions