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

推荐订阅源

WordPress大学
WordPress大学
The Cloudflare Blog
大猫的无限游戏
大猫的无限游戏
小众软件
小众软件
V
Visual Studio Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
博客园 - 司徒正美
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
酷 壳 – CoolShell
酷 壳 – CoolShell
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
月光博客
月光博客
The GitHub Blog
The GitHub Blog
L
LangChain Blog
D
DataBreaches.Net
T
The Blog of Author Tim Ferriss
F
Fortinet All Blogs
博客园 - Franky
阮一峰的网络日志
阮一峰的网络日志
GbyAI
GbyAI
Apple Machine Learning Research
Apple Machine Learning Research
宝玉的分享
宝玉的分享
Engineering at Meta
Engineering at Meta
V
V2EX
MyScale Blog
MyScale 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
Require owner gate for MCP chat command · openclaw/opencl...
joshavant · 2026-06-25 · via Recent Commits to openclaw:main
Original file line numberDiff line numberDiff line change

@@ -84,6 +84,49 @@ describe("handleCommands /mcp", () => {

8484

});

8585

});

8686
87+

it("blocks authorized non-owner senders from writing MCP config", async () => {

88+

await withTempHome("openclaw-command-mcp-home-", async () => {

89+

const workspaceDir = await workspaceHarness.createWorkspace();

90+

mcpServers.set("existing", { command: "uvx", args: ["existing-mcp"] });

91+

const setParams = buildCommandTestParams(

92+

'/mcp set evil={"command":"/bin/sh","args":["-c","id > /tmp/pwned"]}',

93+

buildCfg(),

94+

undefined,

95+

{ workspaceDir },

96+

);

97+

setParams.command.senderIsOwner = false;

98+
99+

const setResult = expectMcpResult(await handleMcpCommand(setParams, true));

100+

expect(setResult).toEqual({ shouldContinue: false });

101+

expect(mcpServers.has("evil")).toBe(false);

102+
103+

const unsetParams = buildCommandTestParams("/mcp unset existing", buildCfg(), undefined, {

104+

workspaceDir,

105+

});

106+

unsetParams.command.senderIsOwner = false;

107+

const unsetResult = expectMcpResult(await handleMcpCommand(unsetParams, true));

108+

expect(unsetResult).toEqual({ shouldContinue: false });

109+

expect(mcpServers.has("existing")).toBe(true);

110+

});

111+

});

112+
113+

it("blocks authorized non-owner senders from reading MCP config", async () => {

114+

await withTempHome("openclaw-command-mcp-home-", async () => {

115+

const workspaceDir = await workspaceHarness.createWorkspace();

116+

mcpServers.set("context7", { command: "uvx", args: ["context7-mcp"] });

117+

const showParams = buildCommandTestParams("/mcp show context7", buildCfg(), undefined, {

118+

workspaceDir,

119+

});

120+

showParams.command.senderIsOwner = false;

121+
122+

const showResult = expectMcpResult(await handleMcpCommand(showParams, true));

123+

expect(showResult).toEqual({ shouldContinue: false });

124+

const replyText = showResult.reply?.text ?? "";

125+

expect(replyText).not.toContain('MCP server "context7"');

126+

expect(replyText).not.toContain('"command": "uvx"');

127+

});

128+

});

129+
87130

it("rejects internal writes without operator.admin", async () => {

88131

await withTempHome("openclaw-command-mcp-home-", async () => {

89132

const workspaceDir = await workspaceHarness.createWorkspace();