-
-
Notifications
You must be signed in to change notification settings - Fork 80.7k
[Bug] Incorrect Sandbox Bind Mount Parsing for Windows Relative Drive-Letter Paths #105667
Copy link
Copy link
Open
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:needs-security-reviewClawSweeper marked this issue as needing security-sensitive review.ClawSweeper marked this issue as needing security-sensitive review.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:securitySecurity boundary, credential, authz, sandbox, or sensitive-data risk.Security boundary, credential, authz, sandbox, or sensitive-data risk.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.
Description
Metadata
Metadata
Assignees
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:needs-security-reviewClawSweeper marked this issue as needing security-sensitive review.ClawSweeper marked this issue as needing security-sensitive review.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:securitySecurity boundary, credential, authz, sandbox, or sensitive-data risk.Security boundary, credential, authz, sandbox, or sensitive-data risk.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.
Type
Fields
Priority
None yet
Summary / Problem Statement
In
splitSandboxBindSpec, the parser splits Docker-style bind specifications (host:container[:options]). On Windows, drive-letter paths start with a colon (e.g.C:\...orC:/...). To prevent splitting on the drive-letter colon, the parser uses a helper functiongetHostContainerSeparatorIndexwhich skips the first colon if it matches a drive prefix.However, the regular expression used to match the drive-letter prefix is:
This regex explicitly requires a slash or backslash after the colon. Windows also supports relative drive-letter paths (e.g.
C:project:\workspaceorC:Users\name), which do not have a slash immediately after the colon.Because of this slash requirement,
hasDriveLetterPrefixevaluates tofalsefor relative drive-letter specs. The loop then starts searching for colons from index 0, matches the colon at index 1 (the drive-letter colon), and incorrectly splits the specification, resulting in:Cproject:\workspaceThis completely breaks downstream path validation and sandbox mounting security gates.
Detailed Technical Context
src/agents/sandbox/bind-spec.ts:C:project:/workspace, it splits at index 1, leading to a host path ofC(which is treated as a relative path and rejected by absolute path checks invalidateBindMounts).Impact Analysis
C:project:/workspace) will have their binds rejected withnon_absolutepath security exceptions.Proposed Solution / Implementation Plan
getHostContainerSeparatorIndexto check if the colon at index 1 is followed by any character other than the bind separator itself, or specifically handle alphanumeric drives:Affected File References