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

Open
#89 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
72/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Quiet
Tech stack
typescript
Domain
cli, security

Research direction

Start by locating resolveWorkspacePath and the shell-tools glob/grep operations, then compare their path handling with the existing cross-platform boundary check in file-tools. Verify that absolute paths outside workspaceRoot are rejected or confined to the workspace, while valid workspace paths still work.

Written by the indexing model from the issue text.

Description

status/needs-triage type/bug
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
Dominant language
TypeScript
Stars
54
Forks
20
Avg merge
2h 58m
Merged PRs (30d)
1

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from stepfun-ai/Step-Code

All issues in stepfun-ai/Step-Code

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.