T09 · Insecure Skill Coding Practices
- Location
src/compact/engine.ts:48- Finding
Conversation Content Enables Shell Command Injection During Compaction
- Content
View full analysis
0 ? Array.from(toolNames).join(', ') : '无'} **文件引用**: ${fileCandidates.size > 0 ? Array.from(fileCandidates).slice(0, 8).join(', ') : '无'} ``` ### Technical Analysis `execSync()` receives a single command string and therefore executes it through a system shell. The implemented escaping only handles backslashes, double quotes, and line endings. It does not neutralize shell substitutions that remain active inside double-quoted arguments, including: - `$(command)` - Backtick command substitution - Other shell-specific expansions Conversation text is copied into `autoTimeline`, incorporated into the prompt, and then interpolated into the shell command. A short payload such as `$(id)` or `$(touch /tmp/marker)` can fit within the 60-characte ...[truncated 1297 chars]- Remediation
View remediation
