feat: v0.8.2 安全纵深补全 · 协议保真 · 断链修复 — 图片SSRF/根MEMORY.md保护根治 · Anthropic thinking回传+pause_turn续传 · 2523 用例全量回归 + E2E 扩充
CI / 类型检查 + Lint + 单元测试 (push) Failing after 9m45s
CI / 全量测试 (Electron ABI) (push) Failing after 6m28s
CI / 产物编译验证 (push) Successful in 11m18s

This commit is contained in:
2026-09-08 14:30:27 +08:00
parent 69776e447f
commit 4cd6e997b5
86 changed files with 4303 additions and 956 deletions
+14
View File
@@ -53,6 +53,20 @@ export function registerMCPHandlers(ctx: IPCContext): void {
) {
return { success: false, error: 'command is required for stdio transport' };
}
// v0.8.2 P2-7: args 类型校验 —— 此前原样透传(非数组也能写入 DB,靠读取侧
// safeParseArgs 兜底为空数组),配置期静默丢参。现显式校验:可选、必须是
// 字符串数组、单项 ≤512 字符、总数 ≤64(防把 args 当数据通道滥用)。
if (config.args !== undefined) {
if (!Array.isArray(config.args) || config.args.some((a) => typeof a !== 'string')) {
return { success: false, error: 'args must be an array of strings' };
}
if (config.args.length > 64) {
return { success: false, error: 'args supports at most 64 entries' };
}
if (config.args.some((a) => (a as string).length > 512)) {
return { success: false, error: 'each arg must be at most 512 characters' };
}
}
// sse / streamable-http 类型必须有合法 url
if (config.transport === 'sse' || config.transport === 'streamable-http') {
if (typeof config.url !== 'string' || !config.url.trim()) {