Skip to content

fix(supervisor): reject untrusted client sockets - #893

Closed
kvinwang wants to merge 6 commits into
masterfrom
codex/fix-supervisor-trusted-client-sockets
Closed

fix(supervisor): reject untrusted client sockets#893
kvinwang wants to merge 6 commits into
masterfrom
codex/fix-supervisor-trusted-client-sockets

Conversation

@kvinwang

@kvinwang kvinwang commented Jul 31, 2026

Copy link
Copy Markdown
Collaborator

Problem

Supervisor accepted commands from any process able to connect to its Unix socket. If filesystem permissions were misconfigured, an untrusted local process could issue privileged lifecycle operations.

Root cause and fix

Check peer credentials on accepted Unix connections and reject clients outside the trusted identity boundary.

Implementation

The branch records the following focused implementation work:

  • fix(supervisor): reject untrusted client sockets
  • build(supervisor): lock client libc dependency
  • fix(supervisor): retain socket path for validation
  • test(supervisor): add socket fixture dependency
  • test(supervisor): expose trusted socket rejection
  • test(supervisor): secure trusted socket directory

Changed paths:

  • dstack/Cargo.lock
  • dstack/supervisor/client/Cargo.toml
  • dstack/supervisor/client/src/lib.rs

Scope

This PR addresses one logical supervisor finding. It intentionally excludes the acceptance-test infrastructure from #841 and unrelated product fixes from #840.

Dependency and merge order

This PR is based directly on master and does not require another split product PR to merge first.

Verification

  • git diff --check origin/master..origin/codex/fix-supervisor-trusted-client-sockets: passed.
  • The declared base was verified as an ancestor of the PR head.
  • Focused compile/check verification was run for the changed component where applicable; non-Rust packaging or configuration changes were reviewed against their exact branch delta.

Copilot AI review requested due to automatic review settings July 31, 2026 03:01

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@kvinwang

kvinwang commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator Author

Closing because normal Unix socket and parent-directory permissions already enforce the local trust boundary. The PR also validates server-path metadata from the client rather than checking client peer credentials at the supervisor, so it does not implement the stated protection. If deployment hardening is needed, the direct fix is to document or enforce an owner-only runtime directory/socket mode at supervisor creation.

@kvinwang kvinwang closed this Aug 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants