Repository navigation
fix: refuse sessions whose trusted PATH others can change; guard the console host on every loopback bind - #77
Merged
Merged
Conversation
Contributor
Author
|
Live run on Daytona's default snapshot, branch at 423f33d. Both sessions passed setup (not refused) and both sandboxes were deleted afterwards.
Shell session: Desktop session: Apple container: the CLI is installed but its service isn't running here, so the provider live tests weren't run on it. |
This comment has been minimized.
This comment has been minimized.
abhishekgahlot2
force-pushed
the
fix/trusted-path
branch
from
October 14, 2026 08:47
423f33d to
d136670
Compare
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.
Two isolation fixes.
Sessions: root's PATH must be root's alone. Root-run session commands and session verifiers find programs through
TRUSTED_PATH(/usr/local/sbinto/bin). Nothing checked that the agent couldn't write those folders, so in an image with a world-writable/usr/local/binthe agent could plant a program the step verifier's wrapper ran as root.Session setup now runs
sandboxes/sealed_path.pyas root, after the work directory is handed to the agent and before anything runs as the agent. Every folder on the PATH, each folder above it, every entry in it and every path a link among them leads through must be root-owned with no group or other write. Links are followed, so merged-/usrimages (/bin->usr/bin) pass. A failure, an error while checking, or any output other thansealedraisesSandboxErrorat setup (no verdict). The check runs once, before the agent acts, and a passing path can't be changed by the agent afterwards. Harbor graders run it on the fresh sandbox before the agent's files are restored.Console: Host guard on every loopback bind.
deepgym console --host ::1(or127.0.0.2,127.1,::ffff:127.0.0.1) skipped the Host-header guard while the page carries the launch token. The guard now applies whenever the host resolves to a loopback address. It accepts the host as given and as browsers write its addresses, and the printed URL brackets IPv6.Tests:
tests/test_sealed_path.py(one case per pass or refusal), setup ordering and fail-closed cases intests/test_sandboxes.py, grader ordering intests/test_harbor_isolation.py, loopback hosts intests/test_cli.py. Not run against live providers.Need help on this PR? Tag
@codesmith-botwith what you need.