Repository navigation
fix(sandbox): keep the network grant current; check fd handoffs structurally - #336
Merged
Merged
Conversation
…o networks recordProjectNetworkGrant returned early for an approved override without network fields, leaving an earlier grant for the same directory in place. The record now always matches the latest approval. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The fd-handoff guard only matched .Fd() on the same line as t.Setenv, so a descriptor read into a variable first slipped past. Parse the test files instead: in any test that sets the key or frame fd env var, every .Fd() call must sit inside syscall.Dup or dupFD. The malformed-value loop of the key-fd parse test now hands over a dup as well and closes it when the reader rejects the value. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…proval A Dockerfile-only approval, or a run with nothing to approve, left an earlier network grant for the directory in place. Every approval path now records the grant for its own override, which drops it when the project requests no networks. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Feed the checker raw handoffs (direct, through a variable, inside a closure) and dup handoffs, so it cannot quietly stop flagging anything. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
odek | b197d26 | Commit Preview URL Branch Preview URL |
Oct 25 2026, 02:32 PM |
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
Two small follow-ups to the sandbox-network hardening released in v2.36.1.
Changes
The project network grant follows the latest approval
Dockerfile.odek-only approval, and a run with nothing to approve.The fd-handoff guard checks structure, not one line
unlinkat: bad file descriptorflake) used to match only.Fd()on the same line ast.Setenv..Fd()call must sit insidesyscall.DupordupFD.TestRED_RtOps_KeyFDStrictParsenow hands over a dup too, and closes it when the reader rejects the value.Testing
TestRED_ProjectNetworkGrant_LaterApprovalWithoutNetworksClearsItandTestRED_ProjectNetworkGrant_ApprovalWithoutOverrideClearsIt, both revert-checked to fail without the fix.TestRED_FDHandoffChecker_FlagsRawAndAcceptsDupcovers the checker.go test -count=1 ./cmd/odekandgo test -race ./cmd/odekpass.golangci-lintreports 0 issues andgofmtis clean.🤖 Generated with Claude Code