Skip to content

Track fd-anchored path hardening for docker workspace provider #114

Closed

Description

@delete-cloud

Summary

The Docker workspace provider in src/coding_agent/environment/docker_workspace_provider.py currently uses Path.resolve(strict=False) containment checks in _validated_workspace_path(). This blocks straightforward path escapes but remains vulnerable to symlink-swap TOCTOU because later file operations reopen by path.

Why this matters

For stronger isolation, especially in compromised-container or untrusted-workload models, host-side file access should be descriptor-anchored instead of path-reopened.

Follow-up scope

  • Replace path-based validation/access with fd-anchored traversal (openat/O_NOFOLLOW-style or equivalent)
  • Apply consistently across read/write/replace/patch/glob/grep/cwd handling
  • Revisit tests for symlink-swap race coverage

Context

Deferred from PR #113 to keep the Docker provider slice bounded to execution/timeout correctness.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions