T09 · Insecure Skill Coding Practices
- Location
scripts/claude-cli-proxy.js:48- Finding
Shell Command Injection Through Configurable Session Name
- Content
View full analysis
&1`, { cwd: CWD, timeout: 10000, encoding: 'utf8', env, }); // Create fresh session execSync(`acpx claude sessions new --name ${SESSION_NAME}`, { cwd: CWD, timeout: 10000, encoding: 'utf8', env, }); ``` ```js // scripts/ccproxy-ensure.js:48 execSync(`acpx claude sessions new --name ${SESSION_NAME}`, { cwd: CWD, timeout: 10000, encoding: 'utf8', env: ENV, }); ``` ```js // scripts/ccproxy-ensure.js:59 execSync(`acpx claude prompt -s ${SESSION_NAME} "warmup"`, { cwd: CWD, timeout: 30000, encoding: 'utf8', env: ENV, }); ``` ### Technical Analysis `SESSION_NAME` is obtained directly from the `CCPROXY_SESSION_NAME` environment variable and interpolated into command strings passed to `execSync`. Node.js executes these strings through a shell, so shell metacharacters in the environment variable are interpreted as command syntax rather than treated as part of a session name. The vulnerability affects session creation, session reset, and warm-up operations. Although other Claude calls use `execFile` with an argument array, the affected calls do not receive equivalent protection. ### Attack Path 1. An attacker gains the ability to set or modify `CCPROXY_SESSION_NAME` in the proxy's environment, LaunchAgent configuration, systemd user service, heartbeat environment, shell profile, or startup wrapper. 2. The attacker assigns a value containing she ...[truncated 907 chars]- Remediation
View remediation
