mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-09 21:14:31 +00:00
refactor(security): unify secure id paths and guard weak patterns
This commit is contained in:
@@ -6,6 +6,7 @@ import { getChannelDock } from "../../channels/dock.js";
|
||||
import type { OpenClawConfig } from "../../config/config.js";
|
||||
import type { SessionEntry } from "../../config/sessions.js";
|
||||
import { logVerbose } from "../../globals.js";
|
||||
import { generateSecureToken } from "../../infra/secure-random.js";
|
||||
import { resolveGatewayMessageChannel } from "../../utils/message-channel.js";
|
||||
import {
|
||||
listReservedChatSlashCommandNames,
|
||||
@@ -210,7 +211,7 @@ export async function handleInlineActions(params: {
|
||||
return { kind: "reply", reply: { text: `❌ Tool not available: ${dispatch.toolName}` } };
|
||||
}
|
||||
|
||||
const toolCallId = `cmd_${Date.now()}_${Math.random().toString(16).slice(2)}`;
|
||||
const toolCallId = `cmd_${generateSecureToken(8)}`;
|
||||
try {
|
||||
const result = await tool.execute(toolCallId, {
|
||||
command: rawArgs,
|
||||
|
||||
Reference in New Issue
Block a user