-
Notifications
You must be signed in to change notification settings - Fork 0
fix(sandbox): bound verification evidence and copied links #1281
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
seonghobae
merged 6 commits into
codex/pr931-bounded-subprocess-core-20260824
from
codex/pr931-sandboxed-verify-stack-20260824
Aug 24, 2026
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
c11f490
fix(sandbox): bound verification evidence
seonghobae c3c209a
merge: refresh bounded subprocess stack base
seonghobae 68bc30e
fix(sandbox): classify missing verification executable
seonghobae 4212bb7
merge: refresh bounded subprocess documentation
seonghobae 1d74487
fix(sandbox): classify non-executable commands
seonghobae 65cae6b
Merge remote-tracking branch 'refs/remotes/origin/pr-1280-head' into …
seonghobae File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| # Sandboxed verification symlink boundary | ||
|
|
||
| ## Incident | ||
|
|
||
| The review verifier copied an untrusted checkout with `shutil.copytree(..., | ||
| symlinks=True)`. That preserves symbolic links rather than copying their | ||
| targets. A pull request could therefore add an absolute link, or a relative | ||
| link containing enough parent traversal, that a verification command followed | ||
| outside the temporary repository. Environment scrubbing did not close that | ||
| filesystem boundary. | ||
|
|
||
| ## Decision | ||
|
|
||
| After applying the copy ignore policy, and before running the untrusted command, | ||
| the verifier walks the exact copied tree without following directory links and | ||
| validates every symbolic link. An absolute target is rejected because the copied | ||
| link would still point at a host path. A relative target is accepted only when | ||
| its fully resolved path remains beneath the copied repository. Safe internal | ||
| relative links remain links so project semantics are preserved. Links under | ||
| ignored paths such as `node_modules` never enter the copy and are not evaluated. | ||
|
|
||
| The validation happens before the untrusted command starts. Rejection is | ||
| fail-closed with stable exit code `122`, `path_boundary_rejected=true` in the | ||
| machine-readable result, and a generic diagnostic that does not disclose the | ||
| resolved host target. It produces no verification success evidence. This is | ||
| filesystem containment, not an operating-system sandbox claim; the existing | ||
| network-mode field remains evidence metadata rather than enforcement. | ||
|
|
||
| The walk is intentionally a pre-execution copy validation, not a continuous | ||
| kernel-enforced filesystem sandbox. A command may create a new symlink after | ||
| validation. The wrapper therefore does not claim to contain a hostile process | ||
| that can mutate its copied workspace during execution; that stronger boundary | ||
| belongs to the surrounding runner or container. The control closes exposure | ||
| introduced by attacker-supplied links already present in the copied checkout. | ||
| Repository-internal symlink cycles remain inside the boundary but can make a | ||
| later verification tool that follows links recurse. Projects must remove such | ||
| cycles or configure the verification tool not to follow them; containment does | ||
| not imply that every internal graph is operationally valid. | ||
|
|
||
| ## Test-first evidence | ||
|
|
||
| `tests/test_sandboxed_verify_symlink_boundary.py` first reproduced the defect: | ||
| an escaping repository link copied successfully instead of raising. The | ||
| accepted tests require rejection of both relative traversal and absolute links, | ||
| including an absolute link back into the original checkout, while retaining a | ||
| safe repository-internal relative link. | ||
|
|
||
| ## Failure, recovery, and rollback | ||
|
|
||
| Repositories that intentionally contain absolute or escaping links must replace | ||
| them with bounded relative links before review verification. A rollback is safe | ||
| only if an independently reviewed replacement proves that no path available to | ||
| the copied command can resolve outside the copy. Dereferencing untrusted links | ||
| during the copy is not an acceptable fallback because it can read the external | ||
| target while constructing the sandbox. | ||
|
|
||
| ## APA 7th reference | ||
|
|
||
| Python Software Foundation. (2026). *shutil—High-level file operations* | ||
| (Python 3.14.6 documentation). Retrieved August 24, 2026, from | ||
| https://docs.python.org/3.14/library/shutil.html#shutil.copytree |
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.