fix(security): remaining session file writes missing 0o600 permissions#18288
Merged
steipete merged 1 commit intoopenclaw:mainfrom Feb 16, 2026
Merged
Conversation
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.
Member
Contributor
Author
|
ops.... |
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.
Problem
#18066 hardened session transcript creation with
0o600permissions intranscript.tsandchat.ts, but three other session file write sites were missed:src/auto-reply/reply/session.ts— forked session transcript header (writeFileSync)src/agents/pi-embedded-runner/session-manager-init.ts— session file reset (writeFile)src/gateway/server-methods/sessions.ts— compacted transcript rewrite (writeFileSync)All three create or rewrite session transcript files that may contain conversation content.
Fix
Set
mode: 0o600on all three write calls, consistent with the pattern established in #18066.Test
Existing tests pass. The two pre-existing failures on main (
server.post-tabs-open-profile-unknown-returns-404andserver-runtime-config) are unrelated.Follow-up to #18066.
Greptile Summary
Follow-up to #18066: applies
mode: 0o600(owner read/write only) to the three remaining session file write sites that were missed in the initial security hardening. The changes are minimal and mechanical — each converts a string encoding argument to an options object with bothencodingandmodefields, consistent with the pattern already established across the codebase.src/agents/pi-embedded-runner/session-manager-init.ts: session file reset during embedded runner initializationsrc/auto-reply/reply/session.ts: forked session transcript header creationsrc/gateway/server-methods/sessions.ts: compacted transcript rewriteNo issues found. All three changes correctly use the Node.js
writeFile/writeFileSyncoptions object API.Confidence Score: 5/5
mode: 0o600). The changes are purely additive security hardening with no behavioral impact on file content. The Node.js API usage is correct in all cases. No new code paths, no logic changes, no risk of regression.Last reviewed commit: 2b43cc5