diff options
Diffstat (limited to 'packages/core/src/tools/glob.ts')
| -rw-r--r-- | packages/core/src/tools/glob.ts | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/packages/core/src/tools/glob.ts b/packages/core/src/tools/glob.ts index 0dd2f411..22dacc83 100644 --- a/packages/core/src/tools/glob.ts +++ b/packages/core/src/tools/glob.ts @@ -122,7 +122,11 @@ export class GlobTool extends BaseTool<GlobToolParams, ToolResult> { } /** - * Checks if a path is within the root directory. + * Checks if a given path is within the root directory bounds. + * This security check prevents accessing files outside the designated root directory. + * + * @param pathToCheck The absolute path to validate + * @returns True if the path is within the root directory, false otherwise */ private isWithinRoot(pathToCheck: string): boolean { const absolutePathToCheck = path.resolve(pathToCheck); |
