mirror of
https://github.com/tiennm99/ccs.git
synced 2026-10-14 02:15:36 +00:00
fix(spawn): sanitize claudecode in shared claude env builders
- strip CLAUDECODE from cliproxy-built Claude environments - enforce sanitization in ClaudeAdapter buildEnv - apply same env hardening in shared spawnClaude helper Refs #588
This commit is contained in:
1 parent
50412dc679
commit
d25eda8435
3 files changed
+11
-5
No files matched your search
@@ -6,7 +6,7 @@
|
||||
*/
|
||||
|
||||
import { spawn, ChildProcess, SpawnOptions } from 'child_process';
|
||||
import { escapeShellArg } from './shell-executor';
|
||||
import { escapeShellArg, stripClaudeCodeEnv } from './shell-executor';
|
||||
import { getClaudeCliInfo } from './claude-detector';
|
||||
import { ErrorManager } from './error-manager';
|
||||
|
||||
@@ -46,7 +46,8 @@ export function spawnClaude(options: SpawnClaudeOptions = {}): SpawnClaudeResult
|
||||
const { args = [], env, cwd, stdio = 'inherit' } = options;
|
||||
|
||||
// Merge environment
|
||||
const mergedEnv = env ? { ...process.env, ...env } : process.env;
|
||||
const mergedEnvBase = env ? { ...process.env, ...env } : process.env;
|
||||
const mergedEnv = stripClaudeCodeEnv(mergedEnvBase);
|
||||
|
||||
let child: ChildProcess;
|
||||
if (needsShell) {
|
||||
|
||||
Reference in new issue
Block a user