fix: validate private state before access - #481
Conversation
|
@codex review Please review commit |
|
Codex Review: Didn't find any major issues. Can't wait for the next one! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
Security review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8f4c05113d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Codex Review: Didn't find any major issues. Keep them coming! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
Security review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
Summary
Make unsafe output-parent errors actionable and validate configured state paths before state-backed operations access data.
The existing ancestry restriction is intentional: a private child can still be renamed or replaced through a writable, non-sticky parent. This change keeps that protection in place.
Changes
This complements the overlap checks in #418. The structured-error work in #463 addresses a separate concern.
Testing
bun test --randomize --seed 12345: 1,323 passed, 11 skipped, 0 failed.pnpm run test: 1,323 passed, 11 skipped, 0 failed.pnpm run types,pnpm run format, Ruff lint on the changed Python script, andgit diff --check: passed.An unchanged login-cleanup test timed out in an earlier full run. It passed in isolated checks on the earlier revisions and in both final full runs. No authentication cleanup code was changed.
Risk and rollout
Existing state roots with group or other permissions, including older
0755directories, now fail state-backed operations. Use a dedicated private state directory, or correct its permissions only when it is yours and safe to change. New workbench state is created privately. The existing global output-ancestry rules are unchanged, and POSIX ownership and mode checks remain platform-gated. The new validation does not change existing state or parent permissions, silently relocate explicit paths, or migrate history or credentials. No dependency or release change is included.Public disclosure review