Case · DiggingBeagle record

MCP filesystem listing could reveal names outside an allowed directory after symlink replacement

A time-of-check to time-of-use symlink swap let listing and search return outside-directory names.

Published by DiggingBeagle:

Scope

@modelcontextprotocol/server-filesystem before 2.4.0; attacker can replace an allowed directory entry with a symlink at the relevant time on the tested filesystem.

Assessment profile

Assessment method
Setting
research demonstration
Exploitation
demonstrated
Evidence
Grade B
Remediation
patch available
AI role
AGAINST AI
Basis and provenance

Vendor or researcher primary evidence establishes the stated mechanism and its bounds; the public record does not support a population-wide impact score, prevalence or generalization to installations without the prerequisites.

Assessed Nov 21, 2026 using diggingbeagle.assessment/1.

At a glance

Mechanism and trust boundary

  1. 01

    Directory passes permitted-root check

    A filesystem listing tool validates a directory inside allowedDirectories while another local process can rename it.

    Boundary: validated directory path -> time of filesystem access

  2. 02

    Directory swapped before listing

    The process replaces that directory with a link to an outside location before readdir, revealing entry names and types rather than file contents.

    Boundary: allowed directory namespace -> external directory listing

Claims & evidence

Implications

The directory was authorized before the filesystem was read, but a local process could rename it and install a symlink before the subsequent readdir. The documented effect is disclosure of entry names and types through listing tools, including a two-user test where the attacker could not list the directory directly. It does not establish reads of protected file contents, and the local rename prerequisite matters.

Controls and mitigations

  • Apply the vendor-provided fixed version where established and restrict network and filesystem rights independently of the model.
  • Replay the documented path with a low-privilege synthetic account and verify the result at the actual side-effect boundary.

Unknowns and contradictions

  • The finding does not demonstrate reading the contents of the files whose names were listed. It depends on an attacker-controlled filesystem race and has no reported production victim.

Sources and citation

Material revision history

  1. Nov 21, 2026 · Published version · first publication · revision 272