T09 · Insecure Skill Coding Practices
- Location
scripts/generate_report.py:24- Finding
Stored HTML and JavaScript Injection in Generated Reports
- Content
View full analysis
拼多多研究报告 - {data.get('query', '')} | PDD Researcher {get_css()}{build_header(data)} {build_score_dashboard(data)} {build_dimension_cards(data)} {build_charts_section(data)} {build_insights_section(data)} {build_action_plan(data)} {build_footer(data)}""" ``` Multiple values are inserted directly into HTML text and attribute contexts: ```python def build_header(data): query = data.get("query", "拼多多分析") analysis_type = data.get("analysis_type", "综合研究") created_at = data.get("created_at", datetime.now().strftime("%Y-%m-%d %H:%M")) data_source = data.get("data_source", "WebSearch + 公开信息") return f"""""" def build_score_dashboard(data): score_data = data.get("scores", {}) overall = score_data.get("overall", {}) score_val = overall.get("value", 0) score_class = "high" if score_val >= 75 else ("medium" if score_val >= 50 else "low") verdict = overall.get("verdict ...[truncated 5950 chars]🔍 拼多多研究报告
{analysis_type} · {query}📅 {created_at} 📊 {data_source} 🏷️ 拼多多- Remediation
View remediation
`, `&`, and the relevant Unicode separators. 6. Add a restrictive Content Security Policy. Prefer external, locally hosted scripts and disallow inline script execution. A nonce- or hash-based policy may be used where inline code cannot immediately be removed. 7. Add regression tests containing payload-like values in every report field and confirm that they appear only as inert text in the generated document. 8. Treat all search-derived material as untrusted, even when it comes from apparently reputable public sources. ]]>
