openclaw/src/plugins/runtime/index.test.ts
Mariano 45db2aa0cd
Security: disable plugin runtime command execution primitive (#20828)
Co-authored-by: mbelinky <mbelinky@users.noreply.github.com>
2026-02-19 10:17:29 +00:00

14 lines
525 B
TypeScript

import { describe, expect, it } from "vitest";
import { createPluginRuntime } from "./index.js";
describe("plugin runtime security hardening", () => {
it("blocks runtime.system.runCommandWithTimeout", async () => {
const runtime = createPluginRuntime();
await expect(
runtime.system.runCommandWithTimeout(["echo", "hello"], { timeoutMs: 1000 }),
).rejects.toThrow(
"runtime.system.runCommandWithTimeout is disabled for security hardening. Use fixed-purpose runtime APIs instead.",
);
});
});