feat: v0.8.2 安全纵深补全 · 协议保真 · 断链修复 — 图片SSRF/根MEMORY.md保护根治 · Anthropic thinking回传+pause_turn续传 · 2523 用例全量回归 + E2E 扩充
This commit is contained in:
@@ -803,6 +803,16 @@ export class SearchFilesTool implements IMetonaTool {
|
||||
} else {
|
||||
// F2-4: 支持多 glob(逗号分隔,如 "*.ts,*.js,*.tsx")
|
||||
if (fileGlob && !matchAnyGlob(entry.name, fileGlob)) continue;
|
||||
// v0.8.2 P1-6: 文件符号链接边界复检 —— 目录 symlink 已不跟随,但文件
|
||||
// symlink 会进入 callback 直接读取内容:工作空间内 `ln -s /etc/passwd
|
||||
// leak.txt` 后内容搜索即可回显外部文件(read_file 有双 realpath 校验,
|
||||
// 此路径此前无防线)。realpath 越出工作空间边界即跳过。
|
||||
if (entry.isSymbolicLink() && workspacePath) {
|
||||
const realFile = await realpath(fullPath).catch(() => null);
|
||||
if (!realFile || !isPathWithinWorkspace(realFile, workspacePath)) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
await callback(fullPath, entry.name);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user