modelcontextprotocol / modelcontextprotocol/servers
Filesystem: fail closed on symlink traversal outside configured roots
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 90.5k
- Forks
- 11.7k
- Avg merge
- 2d 2h
- Merged PRs (30d)
- 5
Description
Problem
Path validation can become ambiguous across symlink hops, allowing access attempts to resolve outside configured filesystem roots.
Why now
Filesystem roots are the primary safety boundary for the reference filesystem server. Symlink traversal ambiguity can quietly break that boundary.
Current insufficiency
There is path validation coverage, but no explicit deterministic reason-coded contract proving that symlink-based escapes are denied before any partial read/write behavior.
Expected behavior
- Requests that resolve through symlinks outside allowed roots fail closed.
- Denials are deterministic and machine-classifiable.
- No partial file reads/writes occur when traversal is rejected.
Validation requirements
- Add regression tests for symlink escape paths.
- Assert denial classification and stable response behavior.
- Verify no content is returned for denied paths.
Scope map
src/filesystem/path-validation.tssrc/filesystem/path-utils.tssrc/filesystem/index.tssrc/filesystem/__tests__/path-validation.test.ts
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with src/filesystem/path-validation.ts and src/filesystem/path-utils.ts, then inspect the filesystem entry point in src/filesystem/index.ts and the existing tests in src/filesystem/tests/path-validation.test.ts. Add regression coverage for symlink escapes, deterministic denial classification, stable responses, and the absence of returned content or partial file operations when access is rejected.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- security
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 48/100