diff --git a/pkg/tools/filesystem.go b/pkg/tools/filesystem.go index 237687734..f1eabd7ab 100644 --- a/pkg/tools/filesystem.go +++ b/pkg/tools/filesystem.go @@ -29,7 +29,7 @@ func validatePath(path, workspace string, restrict bool) (string, error) { } } - if restrict && !strings.HasPrefix(absPath, absWorkspace) { + if restrict && absPath != absWorkspace && !strings.HasPrefix(absPath, absWorkspace+string(filepath.Separator)) { return "", fmt.Errorf("access denied: path is outside the workspace") }