T09 · Insecure Skill Coding Practices
- Location
assets/report_template.html:256- Finding
Untrusted Web Data Is Inserted into Executable HTML and JavaScript Contexts Without Sanitization
- Content
View full analysis
{{SUMMARY_CARDS}}🏠 房源列表全部户型- Remediation
View remediation
`, `&`, U+2028, and U+2029 so serialized values cannot terminate a script element or JavaScript literal. 5. Validate links with a strict URL parser and allow only required schemes, preferably `https:`. Reject `javascript:`, `vbscript:`, unsafe `data:`, and malformed URLs. 6. Validate image URLs separately and avoid generating raw attributes from untrusted strings. 7. If rich HTML is required, sanitize it with a maintained allowlist-based sanitizer. Remove scripts, inline event handlers, dangerous elements, dangerous attributes, and active URL schemes. 8. Add a restrictive Content Security Policy. Prefer external or nonce-protected scripts and prohibit inline event handlers. 9. Update `SKILL.md` to explicitly mandate these controls whenever report placeholders are populated. 10. Add security tests containing payloads for HTML element injection, attribute breakout, script-context breakout, and malicious URL schemes. ]]>
