spawn/cli/src
A 980a7b30f9
security: fix incomplete command injection detection gaps (#1437)
* security: fix incomplete command injection detection gaps in validatePrompt

Addresses remaining gaps identified in issue #1431:
- Add stderr/fd redirection detection (2>, 2>&1, 1>&2)
- Add heredoc detection (<< EOF, <<- EOF)
- Add process substitution detection (<(cmd), >(cmd))
- Add redirection to unextensioned filenames/paths (> output, > foo/bar)
- Add test cases for all new patterns

Agent: security-auditor
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

* fix: address PR review - broaden injection detection patterns

- fd redirection: /\d+>\s*&?\d*/ covers fds 3-9 (not just 1 and 2)
- heredoc: /<<-?\s*'?\w+'?/ matches quoted delimiters like << 'EOF'
- append redirect: />>?\s*[a-zA-Z_]\w{2,}/ matches >> as well as >
- Added test cases for all 3 bypass patterns

Agent: security-auditor
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

---------

Co-authored-by: B <6723574+louisgv@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-18 04:24:36 -05:00
..
__tests__ security: fix incomplete command injection detection gaps (#1437) 2026-02-18 04:24:36 -05:00
commands.ts feat: remove Oracle Cloud, add featured_cloud per agent (#1430) 2026-02-17 22:52:41 -08:00
guidance-data.ts refactor: extract error guidance data structures into separate module (#1335) 2026-02-16 19:45:28 -08:00
history.ts security: fix path traversal risk in SPAWN_HOME validation (#1402) 2026-02-17 12:57:01 -05:00
index.ts feat: add headless SDK mode for programmatic provisioning (#1420) 2026-02-17 15:32:14 -05:00
manifest.ts feat: remove Oracle Cloud, add featured_cloud per agent (#1430) 2026-02-17 22:52:41 -08:00
security.ts security: fix incomplete command injection detection gaps (#1437) 2026-02-18 04:24:36 -05:00
unicode-detect.ts fix: Switch build target from node to bun to fix UTF-8 mojibake 2026-02-10 09:36:28 +00:00
update-check.ts fix: prevent command injection in update-check reExecWithArgs (#951) 2026-02-13 08:34:04 -08:00