Skip to content

fix(deepagents): restrict filesystem paths to root - #665

Open
corridor-security[bot] wants to merge 3 commits into
mainfrom
corridor/fix-1119d955-1783568785287
Open

fix(deepagents): restrict filesystem paths to root#665
corridor-security[bot] wants to merge 3 commits into
mainfrom
corridor/fix-1119d955-1783568785287

Conversation

@corridor-security

Copy link
Copy Markdown
Contributor

Summary

This PR was generated by Corridor to fix:

  • FilesystemBackend allows arbitrary filesystem access when virtualMode is disabled (default)

Changes

The fix closes a high-severity path traversal in FilesystemBackend.resolvePath when virtualMode is off by enforcing a root boundary in both modes. It hoists the traversal check to the top unconditionally and adds a non-virtual path containment check that resolves the absolute path and ensures it remains within this.cwd using path.relative, throwing if it escapes. Previously the non-virtual path accepted absolute paths and did not enforce containment; the virtual-mode behavior remains unchanged, and all 20 tests still pass.


Generated by Corridor

@vercel

vercel Bot commented Jul 9, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
deepagentsjs-ui Ready Ready Preview, Comment Jul 19, 2026 11:53pm

Request Review

@changeset-bot

changeset-bot Bot commented Jul 9, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: d971d1f

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
deepagents Patch
deepagents-acp Patch
@deepagents/evals Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@pkg-pr-new

pkg-pr-new Bot commented Jul 9, 2026

Copy link
Copy Markdown

Open in StackBlitz

deepagents-acp

npm i https://pkg.pr.new/deepagents-acp@665

deepagents

npm i https://pkg.pr.new/deepagents@665

@langchain/sandbox-standard-tests

npm i https://pkg.pr.new/@langchain/sandbox-standard-tests@665

@langchain/daytona

npm i https://pkg.pr.new/@langchain/daytona@665

@langchain/deno

npm i https://pkg.pr.new/@langchain/deno@665

@langchain/modal

npm i https://pkg.pr.new/@langchain/modal@665

@langchain/node-vfs

npm i https://pkg.pr.new/@langchain/node-vfs@665

@langchain/quickjs

npm i https://pkg.pr.new/@langchain/quickjs@665

commit: 80e7593

@jkennedyvz John Kennedy (jkennedyvz) changed the title Fix FilesystemBackend allows arbitrary filesystem access when virtualMode is disabled (default) fix(deepagents): restrict filesystem paths to root Jul 19, 2026
# Conflicts:
#	libs/deepagents/src/backends/filesystem.ts
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.

0 participants