mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-07 00:01:36 +00:00
fix(security): default-deny command execution
This commit is contained in:
@@ -70,6 +70,7 @@ describe("abort detection", () => {
|
||||
ctx: {
|
||||
CommandBody: "/stop",
|
||||
RawBody: "/stop",
|
||||
CommandAuthorized: true,
|
||||
SessionKey: "telegram:123",
|
||||
Provider: "telegram",
|
||||
Surface: "telegram",
|
||||
@@ -132,6 +133,7 @@ describe("abort detection", () => {
|
||||
ctx: {
|
||||
CommandBody: "/stop",
|
||||
RawBody: "/stop",
|
||||
CommandAuthorized: true,
|
||||
SessionKey: sessionKey,
|
||||
Provider: "telegram",
|
||||
Surface: "telegram",
|
||||
@@ -188,6 +190,7 @@ describe("abort detection", () => {
|
||||
ctx: {
|
||||
CommandBody: "/stop",
|
||||
RawBody: "/stop",
|
||||
CommandAuthorized: true,
|
||||
SessionKey: sessionKey,
|
||||
Provider: "telegram",
|
||||
Surface: "telegram",
|
||||
|
||||
@@ -132,7 +132,7 @@ export async function tryFastAbortFromMessage(params: {
|
||||
const abortRequested = normalized === "/stop" || isAbortTrigger(stripped);
|
||||
if (!abortRequested) return { handled: false, aborted: false };
|
||||
|
||||
const commandAuthorized = ctx.CommandAuthorized ?? true;
|
||||
const commandAuthorized = ctx.CommandAuthorized ?? false;
|
||||
const auth = resolveCommandAuthorization({
|
||||
ctx,
|
||||
cfg,
|
||||
|
||||
@@ -84,7 +84,7 @@ export async function getReplyFromConfig(
|
||||
activeModel: { provider, model },
|
||||
});
|
||||
|
||||
const commandAuthorized = ctx.CommandAuthorized ?? true;
|
||||
const commandAuthorized = ctx.CommandAuthorized ?? false;
|
||||
resolveCommandAuthorization({
|
||||
ctx,
|
||||
cfg,
|
||||
|
||||
Reference in New Issue
Block a user