fix(sandbox): block home credential binds#59157
Conversation
|
Closing this PR because the author has more than 10 active PRs in this repo. Please reduce the active PR queue and reopen or resubmit once it is back under the limit. You can close your own PRs to get back under the limit. |
Greptile SummaryThis PR tightens sandbox bind validation by blocking eight credential-bearing home-directory subpaths ( Confidence Score: 5/5Safe to merge; the security fix is correct and well-tested, with one minor documentation inaccuracy to clean up. All findings are P2 (stale JSDoc claiming "no filesystem I/O" on The JSDoc and inline comment on Prompt To Fix All With AIThis is a comment left during a code review.
Path: src/agents/sandbox/validate-sandbox-security.ts
Line: 104-117
Comment:
**Stale "no filesystem I/O" JSDoc contract**
The exported JSDoc on `getBlockedBindReason` explicitly states "String-only blocked-path check (no filesystem I/O)", but after this PR the function calls `getBlockedHostPaths()` → `getBlockedHomeRoots()` → `resolveSandboxHostPathViaExistingAncestor()` which in turn calls `fs.existsSync` and `fs.realpathSync` to canonicalize the home directory. The inline comment at the call-site in `validateBindMounts` ("Fast string-only check") has the same inaccuracy. Callers such as `src/security/audit-extra.sync.ts` happen to tolerate synchronous I/O, but the published contract is now wrong and will mislead future readers.
How can I resolve this? If you propose a fix, please make it concise.Reviews (4): Last reviewed commit: "fix(sandbox): harden blocked credential ..." | Re-trigger Greptile |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 52a4930ca4
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
@codex review |
|
@greptile review |
|
Codex Review: Didn't find any major issues. Delightful! ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
|
Closing this PR because the author has more than 10 active PRs in this repo. Please reduce the active PR queue and reopen or resubmit once it is back under the limit. You can close your own PRs to get back under the limit. |
* fix(sandbox): block home credential binds * fix(sandbox): harden blocked credential bind checks
* fix(sandbox): block home credential binds * fix(sandbox): harden blocked credential bind checks
* fix(sandbox): block home credential binds * fix(sandbox): harden blocked credential bind checks
* fix(sandbox): block home credential binds * fix(sandbox): harden blocked credential bind checks
Summary
Changes
.aws,.cargo,.config,.docker,.gnupg,.netrc,.npm, and.sshvalidateBindMounts()enforcementValidation
corepack pnpm test -- src/agents/sandbox/validate-sandbox-security.test.tsPATH="/app/.local/bin:$PATH" corepack pnpm checkPATH="/app/.local/bin:$PATH" claude -p "/review"; it exited without actionable code feedback in this environment after stopping on an approval promptNotes