T09 · Insecure Skill Coding Practices
- Location
assets/analysis_report_template.html:133- Finding
Stored Cross-Site Scripting Through Unescaped Note-Derived Report Content
- Content
View full analysis
Four: In-depth Insight Analysis
{{INSIGHTS}}{{KEY_FINDINGS}}Five: Detailed Category Descriptions
{{CATEGORY_DETAILS}}``` ```javascript let tableHtml = ''; for (let i = 0; i < categories.length; i++) { const diff = dataYear2[i] - dataYear1[i]; const diffText = diff > 0 ? '+' + diff + '%' : (diff < 0 ? diff + '%' : 'No change'); tableHtml += ` ${categories[i]} ${examples[i]}Six: Optimization Suggestions
-
{{SUGGESTIONS}}
${dataYear1[i]}%${dataYear2[i]}%${trends[i]} ${diffText}
${trendLabels[i]} `; } document.g ...[truncated 2998 chars]- Remediation
View remediation
`, `"`, and `'`. - HTML attribute context: use attribute-specific encoding and prohibit event-handler attributes. - JavaScript context: use a safe JSON serializer that escapes `<`, `>`, `&`, U+2028, U+2029, and script-closing sequences. 4. If formatted HTML is an explicit requirement, sanitize it with a maintained allowlist sanitizer. Allow only required formatting elements and prohibit scripts, event handlers, `javascript:` URLs, iframes, embedded objects, and unsafe CSS. 5. Validate all chart arrays and presentation metadata against strict schemas. Require finite numeric percentages and allowlisted color formats. 6. Add a restrictive Content Security Policy. Prefer external or hashed scripts, prohibit object embedding, and restrict network connections to required destinations. 7. Add security tests using payloads in every note-derived field, including HTML tags, event handlers, malicious URLs, quotes, backticks, and `` sequences. ]]>
