Skip to content
MCP Reference Servers·Indexed by this site · Originally published· Event →SelectedAttention44

MCP fileserver fixes out-of-bounds read in move operation

AI summary

The move_file handler of the MCP reference fileserver @modelcontextprotocol/server-filesystem has a TOCTOU race vulnerability (GHSA-7m4x-rv66-mxhh): a local cooperating process can move a file from outside the allowed directory into the directory and read it in full. The vulnerability stems from the same-device rename path not pinning the source path: the handler first validates the source and destination, then passes the source path as an absolute string to fs.renameSync for the kernel to resolve at rename time; a local process, within the window after validation, swaps the source path's parent directory for a symlink pointing outside, so the rename moves the external file into the pinned destination directory, after which all read tools can return its contents, and the file at its original location is deleted at the same time. npm package versions before 2.3.0 are affected; it is fixed in 2.3.0, and no fixed version exists yet in the interval from 2025.1.14 to 2026.8.31; the report only claims the POSIX import form, and the Windows export variant was not dynamically verified.

Why it was selected

The report gives the race mechanism between source path validation and rename, along with a local reproduction, so teams deploying this server can use it to check versions and upgrade.

Read originalgithub.com