security: block apply_patch path traversal outside workspace#16405
Merged
security: block apply_patch path traversal outside workspace#16405
Conversation
43274ac to
0fcd3f8
Compare
Contributor
Author
This was referenced Feb 14, 2026
Merged
akoscz
pushed a commit
to akoscz/openclaw
that referenced
this pull request
Feb 15, 2026
…w#16405) Merged via /review-pr -> /prepare-pr -> /merge-pr. Prepared head SHA: 0fcd3f8 Co-authored-by: mbelinky <[email protected]> Co-authored-by: mbelinky <[email protected]> Reviewed-by: @mbelinky
GwonHyeok
pushed a commit
to learners-superpumped/openclaw
that referenced
this pull request
Feb 15, 2026
…w#16405) Merged via /review-pr -> /prepare-pr -> /merge-pr. Prepared head SHA: 0fcd3f8 Co-authored-by: mbelinky <[email protected]> Co-authored-by: mbelinky <[email protected]> Reviewed-by: @mbelinky
vincentkoc
pushed a commit
to vincentkoc/openclaw
that referenced
this pull request
Feb 15, 2026
…w#16405) Merged via /review-pr -> /prepare-pr -> /merge-pr. Prepared head SHA: 0fcd3f8 Co-authored-by: mbelinky <[email protected]> Co-authored-by: mbelinky <[email protected]> Reviewed-by: @mbelinky
snowzlm
pushed a commit
to snowzlm/openclaw
that referenced
this pull request
Feb 15, 2026
…w#16405) Merged via /review-pr -> /prepare-pr -> /merge-pr. Prepared head SHA: 0fcd3f8 Co-authored-by: mbelinky <[email protected]> Co-authored-by: mbelinky <[email protected]> Reviewed-by: @mbelinky
jiulingyun
added a commit
to jiulingyun/openclaw-cn
that referenced
this pull request
Feb 15, 2026
hughdidit
pushed a commit
to hughdidit/DAISy-Agency
that referenced
this pull request
Mar 1, 2026
…w#16405) Merged via /review-pr -> /prepare-pr -> /merge-pr. Prepared head SHA: 0fcd3f8 Co-authored-by: mbelinky <[email protected]> Co-authored-by: mbelinky <[email protected]> Reviewed-by: @mbelinky (cherry picked from commit 5544646) # Conflicts: # CHANGELOG.md
This was referenced Mar 1, 2026
hughdidit
pushed a commit
to hughdidit/DAISy-Agency
that referenced
this pull request
Mar 3, 2026
…w#16405) Merged via /review-pr -> /prepare-pr -> /merge-pr. Prepared head SHA: 0fcd3f8 Co-authored-by: mbelinky <[email protected]> Co-authored-by: mbelinky <[email protected]> Reviewed-by: @mbelinky (cherry picked from commit 5544646) # Conflicts: # CHANGELOG.md # src/agents/apply-patch.ts
zooqueen
pushed a commit
to hanzoai/bot
that referenced
this pull request
Mar 6, 2026
…w#16405) Merged via /review-pr -> /prepare-pr -> /merge-pr. Prepared head SHA: 0fcd3f8 Co-authored-by: mbelinky <[email protected]> Co-authored-by: mbelinky <[email protected]> Reviewed-by: @mbelinky
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
apply_patcheven when sandbox mode is not enabledSecurity context
Tests
OPENCLAW_E2E_WORKERS=1 pnpm exec vitest run --config vitest.e2e.config.ts src/agents/apply-patch.e2e.test.tsGreptile Overview
Greptile Summary
This PR closes a critical path traversal vulnerability in
apply_patchthat allowed writes outside the workspace directory. The fix extends sandbox path enforcement to non-sandbox mode by replacing custom path resolution with the sharedassertSandboxPathutility, which validates both path boundaries and symlink escapes.Confidence Score: 5/5
assertSandboxPath, comprehensive test coverage validates all attack vectors (relative traversal, absolute paths, symlink escapes), and the CHANGELOG documents the security context appropriatelyLast reviewed commit: 43274ac