惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Last Week in AI
Last Week in AI
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
博客园_首页
雷峰网
雷峰网
IT之家
IT之家
I
InfoQ
酷 壳 – CoolShell
酷 壳 – CoolShell
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
B
Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
博客园 - 【当耐特】
大猫的无限游戏
大猫的无限游戏
博客园 - 聂微东
Hugging Face - Blog
Hugging Face - Blog
A
About on SuperTechFans
月光博客
月光博客
P
Proofpoint News Feed
博客园 - 三生石上(FineUI控件)
J
Java Code Geeks
G
Google Developers Blog
小众软件
小众软件
宝玉的分享
宝玉的分享
Jina AI
Jina AI
V
Visual Studio Blog

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 fix(macOS): enable undo/redo in webchat composer text input (#34962) · openclaw/openclaw@00951dc Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248 test: mock doctor preview channel boundaries · openclaw/openclaw@b1a3ad4
fix(exec): enforce allowlist argument patterns (#75143) ·...
eleqtrizit · 2026-05-06 · via Recent Commits to openclaw:main

@@ -881,12 +881,6 @@ describe("windowsEscapeArg", () => {

881881

});

882882883883

describe("matchAllowlist with argPattern", () => {

884-

// argPattern matching is Windows-only; skip this suite on other platforms.

885-

if (process.platform !== "win32") {

886-

it.skip("argPattern tests are Windows-only", () => {});

887-

return;

888-

}

889-890884

const resolution = {

891885

rawExecutable: "python3",

892886

resolvedPath: "/usr/bin/python3",

@@ -907,25 +901,57 @@ describe("matchAllowlist with argPattern", () => {

907901

expect(matchAllowlist(entries, resolution, ["python3", "a.py", "--verbose"])).toBeNull();

908902

});

909903910-

it("prefers argPattern match over path-only match", () => {

904+

it.each(["linux", "darwin"])("enforces argPattern on %s", (platform) => {

911905

const entries: ExecAllowlistEntry[] = [

912-

{ pattern: "/usr/bin/python3" },

913-

{ pattern: "/usr/bin/python3", argPattern: "^a\\.py$" },

906+

{ pattern: "/usr/bin/python3", argPattern: "^safe\\.py$" },

914907

];

915-

const match = matchAllowlist(entries, resolution, ["python3", "a.py"]);

916-

expect(match).toBeTruthy();

917-

expect(match!.argPattern).toBe("^a\\.py$");

908+

expect(matchAllowlist(entries, resolution, ["python3", "safe.py"], platform)).toBeTruthy();

909+

expect(matchAllowlist(entries, resolution, ["python3", "-c", "print(1)"], platform)).toBeNull();

918910

});

919911920-

it("falls back to path-only match when argPattern doesn't match", () => {

921-

const entries: ExecAllowlistEntry[] = [

922-

{ pattern: "/usr/bin/python3" },

923-

{ pattern: "/usr/bin/python3", argPattern: "^a\\.py$" },

924-

];

925-

const match = matchAllowlist(entries, resolution, ["python3", "b.py"]);

926-

expect(match).toBeTruthy();

927-

expect(match!.argPattern).toBeUndefined();

928-

});

912+

it.each(["linux", "darwin", "win32"])(

913+

"prefers argPattern match over path-only match on %s",

914+

(platform) => {

915+

const entries: ExecAllowlistEntry[] = [

916+

{ pattern: "/usr/bin/python3" },

917+

{ pattern: "/usr/bin/python3", argPattern: "^a\\.py$" },

918+

];

919+

const match = matchAllowlist(entries, resolution, ["python3", "a.py"], platform);

920+

expect(match).toBeTruthy();

921+

expect(match!.argPattern).toBe("^a\\.py$");

922+

},

923+

);

924+925+

it.each(["linux", "darwin", "win32"])(

926+

"falls back to path-only match when argPattern does not match on %s",

927+

(platform) => {

928+

const entries: ExecAllowlistEntry[] = [

929+

{ pattern: "/usr/bin/python3" },

930+

{ pattern: "/usr/bin/python3", argPattern: "^a\\.py$" },

931+

];

932+

const match = matchAllowlist(entries, resolution, ["python3", "b.py"], platform);

933+

expect(match).toBeTruthy();

934+

expect(match!.argPattern).toBeUndefined();

935+

},

936+

);

937+938+

it.each(["linux", "darwin", "win32"])(

939+

"requires argv before matching argPattern entries on %s",

940+

(platform) => {

941+

const restrictedEntries: ExecAllowlistEntry[] = [

942+

{ pattern: "/usr/bin/python3", argPattern: "^a\\.py$" },

943+

];

944+

expect(matchAllowlist(restrictedEntries, resolution, undefined, platform)).toBeNull();

945+946+

const mixedEntries: ExecAllowlistEntry[] = [

947+

{ pattern: "/usr/bin/python3", argPattern: "^a\\.py$" },

948+

{ pattern: "/usr/bin/python3" },

949+

];

950+

const fallback = matchAllowlist(mixedEntries, resolution, undefined, platform);

951+

expect(fallback).toBeTruthy();

952+

expect(fallback!.argPattern).toBeUndefined();

953+

},

954+

);

929955930956

it("handles invalid regex gracefully", () => {

931957

const entries: ExecAllowlistEntry[] = [{ pattern: "/usr/bin/python3", argPattern: "[invalid" }];