()
| 1289 | } |
| 1290 | |
| 1291 | function 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. |
no test coverage detected