Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

filesystem: realpath ENOENT on Windows SUBST/mapped drives drops roots and refuses valid paths (needs a Windows repro)

Aperta
#5,185 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
48/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
typescript
Ambito
backend

Direzione di ricerca

Start with src/filesystem/roots-utils.ts and its parseRootUri handling, then read src/filesystem/lib.ts around validatePath; prior work in #3948 is cited as a prototype. First reproduce the ENOENT behavior on Windows with a SUBST or mapped drive. Done means valid paths inside an allowed directory resolve while the symlink escape check still holds.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug server-filesystem v2
Problem

On some Windows setups (SUBST drives, some mapped or virtual drives), fs.realpath reportedly fails with ENOENT for a path that exists. On v2, parseRootUri (src/filesystem/roots-utils.ts) then drops the Root as inaccessible, and validatePath (src/filesystem/lib.ts) treats the error as a missing file, so a request for a valid path ends in "Parent directory does not exist".

This has not been reproduced yet and needs a Windows machine with a SUBST drive.

Expected

Paths on such drives resolve and are allowed when they lie inside an allowed directory. Any fix must keep the symlink-escape check intact: falling back to the unresolved path in a way that skips that check is not acceptable.

Prior work
  • #3948 by @krot4u

The PR(s) above targeted the pre-refactor code and are closed as part of the backlog triage in #4875; this issue is where the work continues, with the PR(s) as a prototype. Thank you to their authors.

Lingua principale
TypeScript
Stelle
91.6k
Fork
11.9k
Merge medio
6h 2m
PR unite (30g)
162

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di modelcontextprotocol/servers

Tutte le issue di modelcontextprotocol/servers

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.