T08 · Insecure Dependencies
- Location
workflow/health-check.js:690- Finding
Runtime Installation of Unpinned Packages Based on Subprocess Error Output
- Content
View full analysis
📦 检测到缺失依赖 ${modName},正在自动安装...`) const installCmd = `python3 -m pip install ${shellEscape(modName)} 2>&1` const _installRaw = await callTool('Bash', buildBashCommand('sh', ['-c', installCmd], `安装 ${modName}`, 180000)) const installResult = parseBashOutput(_installRaw) if (installResult.exitCode === 0) { emit(`✅ ${modName} 安装完成,重新执行脚本...`) const _retryRaw = await callTool('Bash', buildBashCommand('python3', bashArgs, description || `重试 ${scriptName}`, 120000, { dataCapture: true })) const retryResult = parseBashOutput(_retryRaw) return parseCliOutput(retryResult, scriptName) } } } ``` The same behavior is repeated for batch execution: ```javascript const modName = detectMissingModule(parsed) if (modName) { emit(`📦 检测到缺失依赖 ${modName},正在自动安装...`) const installCmd = `python3 -m pip install ${shellEscape(modName)} 2>&1` const _installRaw = await callTool('Bash', buildBashCommand('sh', ['-c', installCmd], `安装 ${modName}`, 180000)) if (parseBashOutput(_installRaw).exitCode === 0) { emit(`✅ ${modName} 安装完成,重新取数...`) const _retryRaw = await callTool('Bash', buildBatchCommand(tasks, description)) parsed = parseBatchEnvelope(_retryRaw, keys, description) } } ``` ### Technical Analysis The workflow extracts a Python module name from subprocess error output and passes that name to `pip install` at runtime. Although `shellEscape()` reduces direct shell-command ...[truncated 2168 chars]- Remediation
View remediation
