MCPcopy Create free account
hub / github.com/Noumena-Network/code / getCommandAllowlist

Function getCommandAllowlist

src/tools/BashTool/readOnlyValidation.ts:1291–1305  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1289}
1290
1291function getCommandAllowlist(): Record<string, CommandConfig> {
1292 let allowlist: Record<string, CommandConfig> = COMMAND_ALLOWLIST
1293 // On Windows, xargs can be used as a data-to-code bridge: if a file contains
1294 // a UNC path, `cat file | xargs cat` feeds that path to cat, triggering SMB
1295 // resolution. Since the UNC path is in file contents (not the command string),
1296 // regex-based detection cannot catch this.
1297 if (getPlatform() === 'windows') {
1298 const { xargs: _, ...rest } = allowlist
1299 allowlist = rest
1300 }
1301 if (isInternalBuild()) {
1302 return { ...allowlist, ...ANT_ONLY_COMMAND_ALLOWLIST }
1303 }
1304 return allowlist
1305}
1306
1307/**
1308 * Commands that are safe to use as xargs targets for auto-approval.

Callers 1

Calls 2

getPlatformFunction · 0.85
isInternalBuildFunction · 0.85

Tested by

no test coverage detected