fix(security): create session transcript files with 0o600 permissions#18066
Merged
sebslight merged 2 commits intoopenclaw:mainfrom Feb 16, 2026
Merged
Conversation
c2d63f4 to
35a9002
Compare
Session transcript JSONL files contain full conversation history which may include sensitive information (API keys, tokens, credentials). These files were being created with default umask permissions (typically 0o644, world-readable). Changes: - Set mode: 0o600 when creating new session transcript files in: - src/gateway/server-methods/chat.ts (ensureTranscriptFile) - src/config/sessions/transcript.ts (ensureSessionHeader) - Add JSONL files to security audit --fix scope in src/security/fix.ts This ensures session transcripts are user-only readable, matching the security model applied to other sensitive files like openclaw.json and auth-profiles.json. Fixes openclaw#7862
35a9002 to
962f497
Compare
Member
|
Merged via squash. Thanks @brandonwise! |
treygoff24
pushed a commit
to treygoff24/openclaw
that referenced
this pull request
Feb 16, 2026
…openclaw#18066) Merged via /review-pr -> /prepare-pr -> /merge-pr. Prepared head SHA: 962f497 Co-authored-by: brandonwise <[email protected]> Co-authored-by: sebslight <[email protected]> Reviewed-by: @sebslight (cherry picked from commit 095d522)
xinhuagu
added a commit
to xinhuagu/openclaw
that referenced
this pull request
Feb 16, 2026
…pt and memory write paths Session transcript files created via forkSessionFromParent and the pi-embedded session-manager-init, plus session-memory hook files, were written with default umask permissions instead of 0o600. This is a follow-up to openclaw#18066 which hardened the primary transcript write path but missed these additional call sites. Changes: - auto-reply/reply/session.ts: chmod branched session files to 0o600 after createBranchedSession, and set mode on fallback writeFileSync - pi-embedded-runner/session-manager-init.ts: set mode 0o600 on reset - session-memory/handler.ts: set mode 0o600 on memory file writes - Added permission assertion in session fork test
xinhuagu
added a commit
to xinhuagu/openclaw
that referenced
this pull request
Feb 16, 2026
Follow-up to openclaw#18066 — three session file write sites were missed: - auto-reply/reply/session.ts: forked session transcript header - pi-embedded-runner/session-manager-init.ts: session file reset - gateway/server-methods/sessions.ts: compacted transcript rewrite All now use mode 0o600 consistent with transcript.ts and chat.ts.
steipete
pushed a commit
that referenced
this pull request
Feb 16, 2026
Follow-up to #18066 — three session file write sites were missed: - auto-reply/reply/session.ts: forked session transcript header - pi-embedded-runner/session-manager-init.ts: session file reset - gateway/server-methods/sessions.ts: compacted transcript rewrite All now use mode 0o600 consistent with transcript.ts and chat.ts.
6 tasks
archerhpagent
pushed a commit
to howardpark/openclaw
that referenced
this pull request
Feb 18, 2026
…openclaw#18066) Merged via /review-pr -> /prepare-pr -> /merge-pr. Prepared head SHA: 962f497 Co-authored-by: brandonwise <[email protected]> Co-authored-by: sebslight <[email protected]> Reviewed-by: @sebslight
archerhpagent
pushed a commit
to howardpark/openclaw
that referenced
this pull request
Feb 18, 2026
Follow-up to openclaw#18066 — three session file write sites were missed: - auto-reply/reply/session.ts: forked session transcript header - pi-embedded-runner/session-manager-init.ts: session file reset - gateway/server-methods/sessions.ts: compacted transcript rewrite All now use mode 0o600 consistent with transcript.ts and chat.ts.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Session transcript JSONL files contain full conversation history which may include sensitive information (API keys, tokens, credentials accidentally pasted). These files were being created with default umask permissions (typically
0o644, world-readable).Changes
mode: 0o600when creating new session transcript files in:src/gateway/server-methods/chat.ts(ensureTranscriptFile)src/config/sessions/transcript.ts(ensureSessionHeader).jsonlfiles toopenclaw security audit --fixscope insrc/security/fix.tsThis ensures session transcripts are user-only readable, matching the security model applied to other sensitive files like
openclaw.jsonandauth-profiles.json.Testing
pnpm exec vitest run src/security/fix.test.ts— 5/5 passingpnpm exec vitest run src/config/sessions/sessions.test.ts— 7/7 passingpnpm lint— 0 errorsFixes #7862
Greptile Summary
Restricts session transcript files to user-only permissions (
0o600) to prevent world-readable exposure of sensitive conversation data. The fix applies to both new file creation and existing files viaopenclaw security audit --fix.Confidence Score: 5/5
Last reviewed commit: c2d63f4