Fix: calling URLs with curl
Calling URLs via curl results in the error: “Command blocked by safety guard (path outside working dir)”. This commit fixes the problem.
This commit is contained in:
parent
740cdcaeaf
commit
5368f4a6d0
1 changed files with 4 additions and 0 deletions
|
|
@ -278,6 +278,10 @@ func (t *ExecTool) guardCommand(command, cwd string) string {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if strings.HasPrefix(cmd, "curl -s") && strings.Contains(cmd, "https://") {
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
if t.restrictToWorkspace {
|
if t.restrictToWorkspace {
|
||||||
if strings.Contains(cmd, "..\\") || strings.Contains(cmd, "../") {
|
if strings.Contains(cmd, "..\\") || strings.Contains(cmd, "../") {
|
||||||
return "Command blocked by safety guard (path traversal detected)"
|
return "Command blocked by safety guard (path traversal detected)"
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue