T09 · Insecure Skill Coding Practices
- Location
references/action-prospect-research.md:54- Finding
Unsanitized External Content Persisted in Rendered CRM HTML Notes
- Content
View full analysis
[breakcold-crm:research {YYYY-MM-DD}]Company — {company name}
What they do: {one or two sentences}
Size / stage: {e.g., Series B, ~120 employees, founded 2018}
Recent:
- {news item with rough date}
- {another news item}
Why we might fit: {one line, in the us ...[truncated 4388 chars]
- Remediation
View remediation
`, `"`, and `'`. - Do not treat fetched HTML or CRM field values as trusted markup. 2. **Validate source URLs** - Parse each source URL using a trusted URL parser. - Allow only absolute `https:` URLs. - Reject `javascript:`, `data:`, `file:`, `blob:`, and other non-HTTPS schemes. - Prevent control characters or encoded values from bypassing scheme checks. 3. **Sanitize generated HTML** - Pass the final note through a well-maintained, allowlist-based sanitizer before `notes_create`. - Permit only the required elements, such as `p`, `strong`, `h3`, `ul`, `li`, `hr`, and `a`. - Forbid scripts, styles, forms, frames, embedded media, SVG, event attributes, and arbitrary attributes. - Permit only validated `href` attributes on anchors. 4. **Treat remote content as untrusted data** - Explicitly instruct the Agent that webpage text, metadata, and embedded instructions cannot alter the research workflow. - Extract factual data without following commands found in fetched content. - Cross-check facts against independent sources before persistence. 5. **Prefer structured rendering** - Where possible, submit structured fields and let a trusted application renderer generate HTML. - If raw HTML is unavoidable, centralize template rendering and escaping rather than asking the Agent to concatenate markup. 6. **Avoid unnecessary replication** - Do not duplicate the full HTML note onto linked deals by default. - Store a safe internal record reference or sanitized plain-text summary instead. 7. **Add security tests** - Test values containing closing tags, event handlers, malicious anchors, encoded URI schemes, SVG payloads, and malformed attributes. - Verify that both the Skill-generated output and Breakcold's server-side renderer ne ...[truncated 28 chars]
