Escape compose path and validate custom compose command

fix(security): escape compose path and validate custom compose command
Escape compose path and validate custom compose commandd48037-fix-escape-compose-path-and-validate-custom-cve-2026-72865fixescape compose path validate custom command

Committed by Siumauricio

commit message
fix(security): escape compose path and validate custom compose command

- composePath / appName are now passed through shell-quote in createCommand,
  getCreateEnvFileCommand and services/compose.ts deploy commands, instead of
  being interpolated raw into 'docker compose'/'docker stack' shell commands.
- compose.command: sanitizeCommand was cosmetic (trim + strip quotes). It now
  rejects shell control characters (; & | ` $ () {} <> newline), which a normal
  docker compose CLI line never contains, blocking breakout into host commands.
 
Closes GHSA-8r5w-vqjr-8c44, GHSA-5xv2-7f8w-9j5c, GHSA-qh6h-669j-77rw

Editor assessment

This commit patches CVE-2026-72865. The subject covers two related measures, escaping the compose path and validating the custom compose command, and scope security fits. The body names createCommand, getCreateEnvFileCommand and services/compose.ts as now passing composePath and appName through shell-quote, then explains that sanitizeCommand was merely cosmetic and now rejects shell control characters that a legitimate compose line never contains. It justifies the allowlist reasoning adequately. Three GHSA closures are attached. The mixed remedies are compactly told, though it never sketches how the injection was demonstrated.

Browse categories

More fix examples · Back to search