fix(server): contain API session working directories - #3916
Open
Sayt-0 wants to merge 2 commits into
Open
Conversation
Add a dedicated opt-in root for session working directories created through the HTTP control plane. Resolve symlinks and reject paths outside the configured root while preserving unrestricted local-daemon behavior by default.\n\nDocument the deployment boundary and cover traversal, sibling, symlink, and compatibility cases.
…ed in path expression' Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Sayt-0
enabled auto-merge
August 5, 2026 15:50
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
--session-workingdir-rootboundary for session working directories supplied through the HTTP API--working-diror the process cwd as an implicit security boundarySecurity alert: https://github.com/docker/docker-agent/security/code-scanning/57
Alert expectations
WithSessionWorkingDirRootconstrainsPOST /api/sessionsworking directories when configuredfilepath.EvalSymlinks; containment usesfilepath.Relandfilepath.IsLocalrunConfig.WorkingDirnor the process cwd becomes a boundaryserve apiexposes the flag;run --listenaccepts the same hidden advanced flagValidation
task buildtask lintenv -u HTTP_PROXY -u HTTPS_PROXY -u http_proxy -u https_proxy -u ALL_PROXY -u all_proxy task testnpx --yes markdownlint-cli2@0.22.1 features/api-server/index.md features/cli/index.md./scripts/docs-check-canonical.sh./scripts/docs-check-llms-txt.shThe proxy variables are removed for the test command because the local development proxy intercepts private-address SSRF fixtures; the same failing packages pass without that interception.
Security and compatibility notes