MCPcopy Index your code
hub / github.com/codeaashu/claude-code / checkSubExpressions

Function checkSubExpressions

src/tools/PowerShellTool/powershellSecurity.ts:714–724  ·  view source on GitHub ↗

* AST-only check: Detects subexpressions $() which can hide command execution.

(
  parsed: ParsedPowerShellCommand,
)

Source from the content-addressed store, hash-verified

712 * AST-only check: Detects subexpressions $() which can hide command execution.
713 */
714function checkSubExpressions(
715 parsed: ParsedPowerShellCommand,
716): PowerShellSecurityResult {
717 if (deriveSecurityFlags(parsed).hasSubExpressions) {
718 return {
719 behavior: 'ask',
720 message: 'Command contains subexpressions $()',
721 }
722 }
723 return { behavior: 'passthrough' }
724}
725
726/**
727 * AST-only check: Detects expandable strings (double-quoted) with embedded

Callers

nothing calls this directly

Calls 1

deriveSecurityFlagsFunction · 0.85

Tested by

no test coverage detected