T09 · Insecure Skill Coding Practices
- Location
src/generator.js:260- Finding
Unsanitized User Input Allows Markdown Content Injection
- Content
View full analysis
客户:${client || '未指定'}`); if (industry) lines.push(`> 行业:${industry}`); if (pocGoal) lines.push(`> POC 目标:${pocGoal}`); if (budget) lines.push(`> 客户预算:${budget}`); if (decisionMaker) lines.push(`> 决策人:${decisionMaker}`); lines.push(`> 验证类型:${pocType}`); lines.push(''); // 模块 1:POC 目标对齐 lines.push(`## 🎯 POC 目标对齐`); lines.push(''); if (pocGoal) { lines.push(`- **客户表面诉求**:${pocGoal}`); ``` ### Technical Analysis The report generator inserts the user-controlled `client`, `industry`, `pocGoal`, `budget`, and `decisionMaker` values directly into Markdown without escaping Markdown metacharacters, removing line breaks, or validating embedded URLs. An attacker can include newlines, headings, links, images, block quotes, or raw HTML in these fields. This allows the attacker to alter the structure and apparent meaning of the generated report. If the report is subsequently displayed by an HTML-capable Markdown renderer, injected remote images may trigger requests to attacker-controlled servers. Raw HTML may present additional risks when the renderer permits unsafe HTML. The CLI wrapper uses argument-array spawning without a shell, so this issue does not constitute shell command injection. No direct local code-execution path was identified. ### Attack Path 1. An attacker supplies a crafted CLI field, for example through `--client` or `--poc-goal`, containing line breaks and Markdown content such as a deceptive heading or remote image. 2. `generateReport()` interpolates the value into the report without sanitization. 3. The generated Markdown is copied, saved, shared, or opened in a Markdown viewer. 4. The injected content is rendered as part of the trusted report. 5. If remote resources are enabled, the viewer may connect to an attacker-controlled URL, disclo ...[truncated 881 chars]- Remediation
View remediation
