Skip to content

[BUG]exec工具的guardCommand方法问题 #1042

Description

@icyfire

Quick Summary

当设置restrict_to_workspacetrue时,exec工具的guardCommand方法会判断命令的相对路径是否合法,但是判断方式有点简单粗暴。

举个例子,查询北京的天气,天气技能会执行curl -s "wttr.in/Beijing?T"这个命令,但方法的正则match出来的结果会得到../../../../Beijing?T这样的相对路径,导致Command blocked by safety guard (path outside working dir),问题是这个命令压根不涉及到任何路径。

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions