Skip to content

fix(filesystem): reject Windows paths on POSIX - #4704

Open
CryoThrust wants to merge 1 commit into
modelcontextprotocol:mainfrom
CryoThrust:fix/filesystem-posix-drive-path
Open

fix(filesystem): reject Windows paths on POSIX#4704
CryoThrust wants to merge 1 commit into
modelcontextprotocol:mainfrom
CryoThrust:fix/filesystem-posix-drive-path

Conversation

@CryoThrust

Copy link
Copy Markdown

What does this PR do?

Fixes #4686.

On POSIX hosts, a Windows drive path such as C:\\Users\\me\\notes\\file.md was treated as a relative filename inside the allowed directory. The operation could report success while writing to the wrong path.

Reject drive-letter forms before relative path resolution when running on POSIX. Windows behavior and normal POSIX paths are unchanged. A regression test covers the rejection.

Verification

  • git diff --check passes.
  • Local Vitest execution is currently blocked because the installed Node binary cannot start: Homebrew's simdjson dylib is missing.

@CryoThrust

Copy link
Copy Markdown
Author

The POSIX drive-letter validation change is isolated to validatePath and includes a regression test. CI is green on the branch; ready for review.

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.

filesystem: a Windows-style path is silently accepted on POSIX and becomes a literal filename inside the allowed root

1 participant