You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 22ce3e5
Browse filesBrowse the repository at this point in the historyBrowse files
fix(filesystem): do not trim an allowed directory's name after realpath
normalizePath trims whitespace and strips a leading or trailing quote,
which suits a typed request but not a directory name the file system
returned. resolveAllowedDirectories (both forms of a command-line
directory) and parseRootUri (a Root's realpath) used it, so an allowed
directory named `project ` was allowed as `project`, its sibling.
Use normalizePathFormat, which formats without trimming, for all of
them. The command-line form is not trimmed either: trimming after
path.resolve could only ever drop a trailing character, which is exactly
the sibling case, never a leading quote left over from shell quoting.
Closes#5320
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: cliffhall <[email protected]>
Keep an allowed directory's name exactly as the file system spells it. A command-line directory, or a client Root's realpath, whose name ends in a space or a quote was trimmed, so the server allowed the sibling directory without that suffix (and refused the directory that was actually given).
0 commit comments