T09 · Insecure Skill Coding Practices
- Location
references/web-report-template.md.md:247- Finding
Unescaped Podcast Content in Generated Web Reports
- Content
View full analysis
EP[XX] · [播客名][本期标题]
[核心主题一句话描述]
``` The corresponding template instruction is: ```markdown 1. 将每个 `[占位符]` 替换为实际内容 ``` Translated: replace every placeholder with actual content. ### Technical Analysis The template places podcast-derived or user-controlled fields directly into HTML element content. Its filling instructions require direct placeholder replacement but do not require contextual HTML escaping or sanitization. Podcast titles, transcript excerpts, speaker names, quotes, summaries, and metadata may originate from user input or externally retrieved podcast information. If a value contains active HTML, replacing a placeholder verbatim turns that value into document markup rather than inert text. For example, a malicious title containing an element with an event handler could execute script when the generated report is opened. The template's own JavaScript is benign; the vulnerability arises from unsafe insertion of untrusted content into the generated HTML. ### Attack Path 1. An attacker supplies a crafted podcast title, transcript, quote, or metadata value containing active HTML. 2. The Skill analyzes that content and generates a Web report. 3. Following the template instruction, the Agent replaces an HTML placeholder with the crafted value without escaping it. 4. The resulting report preserves the attacker-controlled HTML as executable markup. 5. A user opens or hosts the generated report in a browser. 6. The injected markup or event handler executes in the security context assigned to the generated document. ### Impact Assessment Successful exploitation can m ...[truncated 531 chars]- Remediation
View remediation
`, `"`, and `'`. 2. Generate dynamic nodes through DOM APIs and assign untrusted text using `textContent` rather than `innerHTML`. 3. If limited formatting is intentionally supported, sanitize it with a maintained strict allowlist that removes: - `
