Skip to content

security(plugins): harden plugin sandbox #141

@HayWolf

Description

@HayWolf

来源

PR #136 review 评估后续跟进项

涉及的 review comments

#7 — plugins.rs:866 — hook handler 路径逃逸(已在 PR 中修复)

#8 — plugins.rs:922 — 插件工具缺少权限执行检查

Plugin manifest 声明了 permissions 和 tool.required_permission,但 execute_plugin_tool 完全不检查权限就直接执行命令。建议实现权限检查框架:在执行前校验 tool.required_permission 是否在 plugin 声明和用户批准的权限范围内。

#21 — plugins.rs:1239 — 插件 MCP server URL 无 SSRF 防护

read_plugin_mcp_server_entries 从 manifest 读取的 MCP URL 直接存入配置并可能 auto_start,无 scheme 白名单或 private IP 过滤。建议在存储前验证 URL(scheme 限制为 https/wss,拒绝 private/internal IP ranges,拒绝 file:// 等本地协议)。

建议

权限执行框架(#8)是较大的设计工作,建议先讨论权限模型再实现。URL 验证(#21)可作为轻量快速修复。

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions