fix(security): validate session IDs and enforce private file modes - #1105
Closed
avion23 wants to merge 3 commits into
Closed
fix(security): validate session IDs and enforce private file modes#1105avion23 wants to merge 3 commits into
avion23 wants to merge 3 commits into
Conversation
Contributor
|
Thank you for the report and proposed work. This root cause is now covered by maintainer-owned stacked PR #1159, authored independently from We did not inspect or reuse this PR's diff, branch, commits, implementation code, or tests; its public description/comments were used only as a bug report. To keep one review surface, this PR is superseded by #1159 and is being closed. The complete review stack is #1158–#1165. It is being left unmerged for human review after CI and review-bot findings are cleared. |
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 ID could escapesession-artifacts, and agent-session prewarm coulddill.load()attacker-controlled content for arbitrary code execution.0600files, exclusive no-follow temporary files, and atomic replacement where applicable.0600.Evidence
Before the fix, the upstream implementation failed the new security probe:
After the fix:
Related fork commits
Note
Validate session IDs and enforce private file modes across auth, session, and log paths
SESSION_ID_PATTERNvalidation insession-manager.tsto reject path-traversal and malformed session IDs at all entry points (getSessionFilePath,newSession,setSessionFile,finalizeLoadedEntries).getSessionArtifactPathto prevent artifact directory escapes.cli.tsandauth-storage.tsto use atomic writes (O_CREAT|O_EXCL|O_NOFOLLOW) with 0600 file modes and symlink rejection.Macroscope summarized a923f00.