Skip to content

Commit 9662cbd

Browse files
committed
docs: add security warning comment in code-execution-executor.ts
Add a TODO comment explaining that using new Function() with user-provided code introduces a code injection vulnerability. This clarifies the security risk for future reviewers and maintainers.
1 parent 312285b commit 9662cbd

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/core/src/executors/code-execution/code-execution-executor.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,8 @@ export class CodeExecutionExecutor {
241241
return await this.server.callTool(toolName, params);
242242
};
243243

244-
// Create and execute function with injected APIs
244+
// Create and execute function with injected APIs,
245+
// TODO: using new Function() with user-provided code creates a code injection vulnerability, using deno to sandbox would be safer.
245246
const fn = new Function(
246247
"console",
247248
"callMCPTool",

0 commit comments

Comments
 (0)