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
commit fa79736b87
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

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`)
}