mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 15:48:28 +00:00
fix(security): harden untrusted web tool transcripts
This commit is contained in:
@@ -19,13 +19,14 @@ export async function runBeforeToolCallHook(args: {
|
||||
toolCallId?: string;
|
||||
ctx?: HookContext;
|
||||
}): Promise<HookOutcome> {
|
||||
const toolName = normalizeToolName(args.toolName || "tool");
|
||||
const params = args.params;
|
||||
|
||||
const hookRunner = getGlobalHookRunner();
|
||||
if (!hookRunner?.hasHooks("before_tool_call")) {
|
||||
return { blocked: false, params: args.params };
|
||||
}
|
||||
|
||||
const toolName = normalizeToolName(args.toolName || "tool");
|
||||
const params = args.params;
|
||||
try {
|
||||
const normalizedParams = isPlainObject(params) ? params : {};
|
||||
const hookResult = await hookRunner.runBeforeToolCall(
|
||||
|
||||
Reference in New Issue
Block a user