spawn/sh
A 15df9dfae3
fix(security): array-based agent detection and GCP instance name validation (#3158)
* fix(security): array-based agent detection and GCP instance name validation

Replace shell string concatenation in detectAgent() with individual
`command -v` calls per agent, eliminating the compound shell command.
Add _gcp_validate_instance_name() to validate GCP instance names match
[a-z][a-z0-9-]*[a-z0-9] before passing to gcloud commands.

Fixes #3151
Fixes #3149

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

* fix: add instance name validation in _gcp_cleanup_stale()

Defense-in-depth: validate instance names from GCP API before passing
to gcloud delete, consistent with validation at other call sites.

Agent: pr-maintainer
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-04-03 11:24:33 +07:00
..
aws feat: add Pi coding agent (shittycodingagent.ai) to spawn (#3128) 2026-03-31 17:34:34 -07:00
cli fix(security): use grep -F for literal string matching in PATH checks (#3021) 2026-03-27 02:56:07 +07:00
digitalocean feat: add Pi coding agent (shittycodingagent.ai) to spawn (#3128) 2026-03-31 17:34:34 -07:00
docker fix(zeroclaw): remove broken zeroclaw agent (repo 404) (#3107) 2026-03-30 15:35:40 -07:00
e2e fix(security): array-based agent detection and GCP instance name validation (#3158) 2026-04-03 11:24:33 +07:00
gcp feat: add Pi coding agent (shittycodingagent.ai) to spawn (#3128) 2026-03-31 17:34:34 -07:00
hetzner feat: add Pi coding agent (shittycodingagent.ai) to spawn (#3128) 2026-03-31 17:34:34 -07:00
local feat: add Pi coding agent (shittycodingagent.ai) to spawn (#3128) 2026-03-31 17:34:34 -07:00
shared fix(github-auth): add sudo availability check before use (#3072) 2026-03-28 08:39:22 +07:00
sprite feat: add Pi coding agent (shittycodingagent.ai) to spawn (#3128) 2026-03-31 17:34:34 -07:00
test fix(zeroclaw): remove broken zeroclaw agent (repo 404) (#3107) 2026-03-30 15:35:40 -07:00