-
Notifications
You must be signed in to change notification settings - Fork 12
Closed
Labels
safe-to-workSecurity triage: safe for automated processingSecurity triage: safe for automated processing
Description
Severity
CRITICAL
Location
packages/cli/src/shared/orchestrate.ts:44
Description
The makeDockerExec function wraps user-controlled commands for Docker container execution. While shellQuote is used, the command passes through multiple shell layers (bash -c inside Docker), which could allow injection if crafted payloads survive the quoting.
Vulnerable Code
export function makeDockerExec(cmd: string): string {
return \`docker exec ${DOCKER_CONTAINER_NAME} bash -c ${shellQuote(cmd)}\`;
}Attack Vector
If cmd contains shell metacharacters that survive shellQuote, they could be executed on the host or inside the container. The nested shell execution (docker exec ... bash -c ...) creates multiple interpretation layers.
Recommendation
- Use
docker execwith array arguments instead of shell string interpolation - Validate that
cmddoesn't contain dangerous patterns before wrapping - Avoid nested shell execution layers where possible
Impact
An attacker who can control the cmd parameter could potentially:
- Execute arbitrary commands inside the container
- Break out of intended command restrictions
- Access sensitive data or credentials inside the container
-- security/code-scanner
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
safe-to-workSecurity triage: safe for automated processingSecurity triage: safe for automated processing