refactor: update file write operations to use copy instead of rename … - #3218
refactor: update file write operations to use copy instead of rename …#3218mahdirajaee wants to merge 1 commit into
Conversation
…for improved safety
|
@claude review |
|
Claude finished @cliffhall's task in 2m 10s —— View job PR Review
SummaryThis PR replaces Critical Issue: Security Regression (TOCTOU / Symlink Attack)The original code was deliberately using Here's why this matters:
The filesystem server's core security model is path-based access control ( Moderate Issue: The Fix May Not Actually Resolve the Windows EPERMThe Windows A more targeted fix would be: if (process.platform === 'win32') {
// On Windows, rename can fail with EPERM when destination is locked.
// copyFile+unlink is less atomic but handles this case.
await fs.copyFile(tempPath, filePath);
await fs.unlink(tempPath);
} else {
// On POSIX: atomic, non-symlink-following replacement.
await fs.rename(tempPath, filePath);
}Minor: Error HandlingThe shift from TestsThe test updates in PR TemplateThe PR description template is completely unfilled — no server specified, no motivation, no testing details, no checklist items checked. This makes it hard to understand the full scope and test coverage. VerdictRequest changes. The security regression introduced by switching from |
…for improved safety
Description
Publishing Your Server
Note: We are no longer accepting PRs to add servers to the README. Instead, please publish your server to the MCP Server Registry to make it discoverable to the MCP ecosystem.
To publish your server, follow the quickstart guide. You can browse published servers at https://registry.modelcontextprotocol.io/.
Server Details
Motivation and Context
How Has This Been Tested?
Breaking Changes
Types of changes
Checklist
Additional context