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:
Björn Renzel 2026-02-25 15:31:12 +01:00 committed by GitHub
parent 740cdcaeaf
commit 5368f4a6d0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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)"