cli/pkg
Snider febdb1ba92 Sanitize user input in execInContainer to prevent injection (#305)
* security: sanitize user input in execInContainer

This change implements command injection protection for the 'vm exec' command
by adding a command whitelist and robust shell argument escaping.

Changes:
- Added `escapeShellArg` utility in `pkg/container/linuxkit.go` to safely quote
  arguments for the remote shell.
- Updated `LinuxKitManager.Exec` to escape all command arguments before
  passing them to SSH.
- Implemented `allowedExecCommands` whitelist in `internal/cmd/vm/cmd_container.go`.
- Added i18n support for new security-related error messages.
- Added unit tests for escaping logic and whitelist validation.

Fixes findings from OWASP Top 10 Security Audit (PR #205).

* security: sanitize user input in execInContainer

This change implements command injection protection for the 'vm exec' command
by adding a command whitelist and robust shell argument escaping.

Changes:
- Added `escapeShellArg` utility in `pkg/container/linuxkit.go` to safely quote
  arguments for the remote shell.
- Updated `LinuxKitManager.Exec` to escape all command arguments before
  passing them to SSH.
- Implemented `allowedExecCommands` whitelist in `internal/cmd/vm/cmd_container.go`.
- Added i18n support for new security-related error messages.
- Added unit tests for escaping logic and whitelist validation.
- Fixed minor formatting issue in `pkg/io/local/client.go`.

Fixes findings from OWASP Top 10 Security Audit (PR #205).

* security: sanitize user input in execInContainer

This change implements command injection protection for the 'vm exec' command
by adding a command whitelist and robust shell argument escaping.

Changes:
- Added `escapeShellArg` utility in `pkg/container/linuxkit.go` to safely quote
  arguments for the remote shell (mitigates SSH command injection).
- Updated `LinuxKitManager.Exec` to escape all command arguments.
- Implemented `allowedExecCommands` whitelist in `internal/cmd/vm/cmd_container.go`.
- Added i18n support for new security-related error messages in `en_GB.json`.
- Added unit tests for escaping logic and whitelist validation.
- Fixed a minor pre-existing formatting issue in `pkg/io/local/client.go`.

Note: The 'merge / auto-merge' CI failure was identified as an external
reusable workflow issue (missing repository context for the 'gh' CLI), and
has been left unchanged to maintain PR scope and security policies.

Fixes findings from OWASP Top 10 Security Audit (PR #205).
2026-02-05 03:43:12 +00:00
..
agentic feat: infrastructure packages and lint cleanup (#281) 2026-02-04 11:34:43 +00:00
ai feat: infrastructure packages and lint cleanup (#281) 2026-02-04 11:34:43 +00:00
ansible feat: infrastructure packages and lint cleanup (#281) 2026-02-04 11:34:43 +00:00
build Migrate pkg/build to io.Medium abstraction (#287) 2026-02-04 17:59:10 +00:00
cache chore(io): migrate pkg/cache to Medium abstraction (#288) 2026-02-04 15:15:46 +00:00
cli Migrate pkg/repos to Medium abstraction (#291) 2026-02-04 18:03:54 +00:00
collect feat: infrastructure packages and lint cleanup (#281) 2026-02-04 11:34:43 +00:00
config feat: infrastructure packages and lint cleanup (#281) 2026-02-04 11:34:43 +00:00
container Sanitize user input in execInContainer to prevent injection (#305) 2026-02-05 03:43:12 +00:00
crypt feat: infrastructure packages and lint cleanup (#281) 2026-02-04 11:34:43 +00:00
deploy feat: wire release command, add tar.xz support, unified installers (#277) 2026-02-04 00:49:57 +00:00
devops Migrate pkg/container to io.Medium abstraction (#292) 2026-02-04 15:33:22 +00:00
errors feat(errors): Unify errors and logging (#180) 2026-02-02 06:48:40 +00:00
framework refactor(core): decompose Core into serviceManager + messageBus (#282) 2026-02-04 13:40:16 +00:00
git feat: git command, build improvements, and go fmt git-aware (#74) 2026-02-01 10:48:44 +00:00
gitea feat(gitea): add Gitea Go SDK integration and CLI commands (#324) 2026-02-04 21:12:12 +00:00
help feat: Batch implementation of Gemini issues (#176) 2026-02-02 04:20:18 +00:00
i18n Sanitize user input in execInContainer to prevent injection (#305) 2026-02-05 03:43:12 +00:00
io fix(ci): gofmt base branch + auto-merge permissions (#323) 2026-02-04 18:38:41 +00:00
log feat: infrastructure packages and lint cleanup (#281) 2026-02-04 11:34:43 +00:00
mcp feat(io): Migrate pkg/mcp to use Medium abstraction (#289) 2026-02-04 15:02:47 +00:00
plugin feat: infrastructure packages and lint cleanup (#281) 2026-02-04 11:34:43 +00:00
process feat: infrastructure packages and lint cleanup (#281) 2026-02-04 11:34:43 +00:00
rag style: fix gofmt formatting across all affected files (#279) 2026-02-04 01:27:01 +00:00
release Migrate pkg/build to io.Medium abstraction (#287) 2026-02-04 17:59:10 +00:00
repos Migrate pkg/repos to Medium abstraction (#291) 2026-02-04 18:03:54 +00:00
unifi feat(release): add Homebrew tap support and fix artifact naming (#325) 2026-02-05 01:37:02 +00:00