fix: check worktree for external_directory permission in subdirs (#7811)

This commit is contained in:
Dillon Mulroy
2026-01-11 15:17:36 -05:00
committed by GitHub
parent 2e0c2c9db7
commit fa79736b87
5 changed files with 101 additions and 6 deletions

View File

@@ -279,7 +279,7 @@ export namespace File {
// TODO: Filesystem.contains is lexical only - symlinks inside the project can escape.
// TODO: On Windows, cross-drive paths bypass this check. Consider realpath canonicalization.
if (!Filesystem.contains(Instance.directory, full)) {
if (!Instance.containsPath(full)) {
throw new Error(`Access denied: path escapes project directory`)
}
@@ -339,7 +339,7 @@ export namespace File {
// TODO: Filesystem.contains is lexical only - symlinks inside the project can escape.
// TODO: On Windows, cross-drive paths bypass this check. Consider realpath canonicalization.
if (!Filesystem.contains(Instance.directory, resolved)) {
if (!Instance.containsPath(resolved)) {
throw new Error(`Access denied: path escapes project directory`)
}