mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 09:41:36 +00:00
fix(security): harden runtime command override gating
This commit is contained in:
@@ -62,6 +62,20 @@ describe("commands registry", () => {
|
||||
expect(nativeDisabled.find((spec) => spec.name === "debug")).toBeFalsy();
|
||||
});
|
||||
|
||||
it("does not enable restricted commands from inherited flags", () => {
|
||||
const inheritedCommands = Object.create({
|
||||
config: true,
|
||||
debug: true,
|
||||
bash: true,
|
||||
}) as Record<string, unknown>;
|
||||
const commands = listChatCommandsForConfig({
|
||||
commands: inheritedCommands as never,
|
||||
});
|
||||
expect(commands.find((spec) => spec.key === "config")).toBeFalsy();
|
||||
expect(commands.find((spec) => spec.key === "debug")).toBeFalsy();
|
||||
expect(commands.find((spec) => spec.key === "bash")).toBeFalsy();
|
||||
});
|
||||
|
||||
it("appends skill commands when provided", () => {
|
||||
const skillCommands = [
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user