Repository navigation
fix(sandbox): ensure skill mount dirs exist before read-only mount resolution - #94460
Closed
qingminglong wants to merge 1 commit into
Closed
qingminglong wants to merge 1 commit into
qingminglong wants to merge 1 commit into
Conversation
…solution Sandbox skill directories (skills, .agents/skills, .openclaw/sandbox-skills) are now created via fs.mkdirSync before isExistingWorkspaceSkillMountSource checks them. This fixes the vulnerability where these directories didn't exist on first agent launch, causing the read-only mount to be skipped and making skill sources writable inside the sandbox. Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Contributor
Author
|
Have a nice day, please help me merge |
This was referenced Jun 19, 2026
Closed
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
Fixes #94425
Real behavior proof (required for external PRs)
Behavior addressed: On first sandbox agent launch, skill source directories don't exist yet because ensureAgentWorkspace doesn't create them. isExistingWorkspaceSkillMountSource returns false for non-existent directories, so resolveReadOnlyWorkspaceSkillMounts returns an empty list - the read-only overlay mount is skipped entirely.
Real setup tested:
Exact steps or command run after fix:
After-fix evidence:
Observed result after the fix: All 101 tests pass across 5 test files. The mkdirSync loop creates all 3 skill directories before isExistingWorkspaceSkillMountSource filtering, so read-only mounts are consistently applied even on first launch.
What was not tested: Full Docker sandbox end-to-end (requires Docker daemon). The fix is validated through unit tests.
Proof limitations or environment constraints: Unit tests verify the mount arg output matches expectations; a Docker integration test would additionally confirm the container layers compose correctly.
Tests and validation
All 5 test files pass (101 tests total):
Risk checklist
Did user-visible behavior change? (No)
Did config, environment, or migration behavior change? (No)
Did security, auth, secrets, network, or tool execution behavior change? (Yes)
What is the highest-risk area?
How is that risk mitigated?
Current review state
What is the next action?
What is still waiting on author, maintainer, CI, or external proof?
Which bot or reviewer comments were addressed?