Skip to content

[bug] 路径穿越(绝对路径绕过 workspace 边界) #89

Description

@Misaka477

step-realtime-cli 版本

1.0.0

Node 版本 & OS

Node 24.16.0 / Linux (Fedora 44)

复现步骤

  1. 在 step CLI 中对助手说"读取 /etc/passwd"
  2. 模型调用 glob/grep 工具时传入绝对路径参数
  3. resolveWorkspacePath 直接返回 /etc/passwd
  4. 文件内容被读取并返回给模型

期望行为

绝对路径应验证前缀为 workspaceRoot,否则拒绝或 resolve 到 workspace root。file-tools 已有类似的跨平台边界检查,shell-tools 的 glob/grep 操作缺了这层

实际行为

绝对路径被直接使用,可读取 workspace 外任意文件

日志 / 堆栈

截图(可选)

No response

自检

  • 我已搜索 existing issues,确认这不是重复问题
  • 我已阅读 CONTRIBUTING.md

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions