mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-11 20:13:43 +00:00
fix: harden exec allowlist regex literal handling (#32162) (thanks @stakeswky)
This commit is contained in:
@@ -102,6 +102,16 @@ describe("exec approvals allowlist matching", () => {
|
||||
});
|
||||
expect(match?.pattern).toBe("/usr/bin/*++");
|
||||
});
|
||||
|
||||
it("matches paths containing []() regex tokens literally", () => {
|
||||
const literalPattern = "/opt/builds/tool[1](stable)";
|
||||
const match = matchAllowlist([{ pattern: literalPattern }], {
|
||||
rawExecutable: literalPattern,
|
||||
resolvedPath: literalPattern,
|
||||
executableName: "tool[1](stable)",
|
||||
});
|
||||
expect(match?.pattern).toBe(literalPattern);
|
||||
});
|
||||
});
|
||||
|
||||
describe("mergeExecApprovalsSocketDefaults", () => {
|
||||
|
||||
Reference in New Issue
Block a user