mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 07:41:23 +00:00
fix: block safeBins sort --compress-program bypass
This commit is contained in:
@@ -222,6 +222,24 @@ describe("createOpenClawCodingTools safeBins", () => {
|
||||
}
|
||||
});
|
||||
|
||||
it("blocks sort --compress-program from bypassing safeBins", async () => {
|
||||
if (process.platform === "win32") {
|
||||
return;
|
||||
}
|
||||
|
||||
const { tmpDir, execTool } = await createSafeBinsExecTool({
|
||||
tmpPrefix: "openclaw-safe-bins-sort-compress-",
|
||||
safeBins: ["sort"],
|
||||
});
|
||||
|
||||
await expect(
|
||||
execTool.execute("call1", {
|
||||
command: "sort --compress-program=sh",
|
||||
workdir: tmpDir,
|
||||
}),
|
||||
).rejects.toThrow("exec denied: allowlist miss");
|
||||
});
|
||||
|
||||
it("blocks shell redirection metacharacters in safeBins mode", async () => {
|
||||
if (process.platform === "win32") {
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user