You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(security): remediate command injection, path traversal, and SSRF vulnerabilities (#1353)
Command injection (CVSS 8.4-10.0):
- src/utils/git.ts: autoCommit switches from exec (shell) to execFile
(argv array), neutralizing injection via shell metacharacters in relPath
- packages/evals/src/cli/processTask.ts: processTaskInContainer uses
execa('docker', args) without shell:true; each -e K=V is its own argv
- packages/evals/src/cli/runTaskInVscode.ts: pass jobToken via env object
instead of interpolating into the shell command (mirrors runTaskInCli)
- .roo/rules-issue-writer/1_workflow.xml + 3_best_practices.xml: use a
quoted heredoc (--body-file - <<'ISSUE_EOF') so issue body is never
shell-expanded; correct the unsafe 'robust quoting' guidance
- apps/web-evals/src/lib/schemas.ts: add regex allowlist to jobToken
SSRF (CVSS 6.9):
- apps/web-roo-code/src/app/api/og/route.tsx: derive baseUrl from
NEXT_PUBLIC_SITE_URL instead of the client-controlled Host header
Path traversal (aligned to the approval model; outside-workspace access
remains a user-controlled feature, so no hard workspace-boundary deny):
- src/core/tools/FileOutline.ts: add askApproval before reading
- src/core/tools/WriteToFileTool.ts: remove untracked pre-approval
createDirectoriesForFile; defer to diffViewProvider which tracks/rollbacks
- src/core/tools/GenerateImageTool.ts: defer input-image read to after
approval; surface inputImageOutsideWorkspace in the approval prompt
- src/core/checkpoints/index.ts: add isPathWithin boundary check to the
non-interactive metadata helper (runs even on tool denial)
- src/utils/pathUtils.ts: add isPathWithin(filePath, baseDir) checking
against a given base dir to avoid the workspaceFolders false-positive
regression in CLI / custom-working-dir modes
Test: writeToFileTool.spec.ts updated to assert deferred dir creation.
Use --body with robust quoting (for example: --body "$(printf '%s\n' "[ISSUE_BODY]")") or a heredoc; do not create temporary files or reference file paths. Always include --repo "[OWNER_REPO]" and echo the resulting issue URL.
60
+
Pass the issue body via a quoted heredoc with --body-file - (for example: `gh issue create ... --body-file - <<'ISSUE_EOF'` followed by the body and `ISSUE_EOF`). The quoted delimiter `<<'ISSUE_EOF'` disables ALL shell expansion, so quotes, `$`, backticks, or `;` inside the body cannot inject commands.
61
+
NEVER embed [ISSUE_BODY] inside a double-quoted shell argument such as `--body "$(printf '%s\n' "[ISSUE_BODY]")"` — a `"` in the body closes the quote and allows command injection.
62
+
For [ISSUE_TITLE], keep the derived title to plain alphanumerics, spaces, and common punctuation only; strip any `"`, `$`, backticks, or `;` before substitution, since the title is passed via gh's --title argument.
63
+
Do not create temporary files or reference file paths. Always include --repo "[OWNER_REPO]" and echo the resulting issue URL.
61
64
In execute_command calls, output only the command string; never include XML tags, CDATA markers, code fences, or backticks in the command payload.
0 commit comments