mirror of
https://github.com/tiennm99/ccs.git
synced 2026-08-15 16:23:45 +00:00
fix(dispatcher): also treat -p as non-subcommand short for --print (#1352)
Red-team follow-up to #1341: the original fix only guarded --print but Claude accepts -p as the short form, and CCS itself passes -p in headless-executor.ts. Without this check the security bypass survived via the short flag. Added regression tests: ['-p', 'agents'], ['-p', 'doctor'], ['-p'] alone, and injector short-circuit verification for -p form.
This commit is contained in:
@@ -144,7 +144,7 @@ export function getClaudeSubcommandName(args: readonly string[]): string | null
|
||||
const arg = args[i];
|
||||
if (arg === '--') return null;
|
||||
|
||||
if (arg === '--print') return null;
|
||||
if (arg === '--print' || arg === '-p') return null;
|
||||
|
||||
if (arg.startsWith('-')) {
|
||||
if (VALUE_TAKING_FLAGS.has(arg)) {
|
||||
|
||||
Reference in New Issue
Block a user