T09 · Insecure Skill Coding Practices
- Location
monitor.py:277- Finding
Unsanitized Indeed Content Persisted into the Markdown Lead Database
- Content
View full analysis
- Remediation
View remediation
`. - Neutralize Markdown link and image syntax where rendered links are unnecessary. 3. Enforce maximum lengths and an allowlist of expected characters for company names, titles, and locations. 4. Prefer a structured storage format such as JSON or properly generated CSV. If Markdown is required, generate it from validated structured data using a safe serialization function. 5. Label scraped text as untrusted external content when supplying it to an AI system. Keep data fields separate from system or task instructions and instruct the downstream agent never to follow instructions contained in lead records. 6. Consider rejecting records containing control characters, embedded URLs, multiline content, or instruction-like payloads. For example: ```python def escape_markdown_cell(value, max_length=200): value = str(value or "") value = value.replace("\r", " ").replace("\n", " ") value = value.replace("\\", "\\\\").replace("|", "\\|") value = value.replace("<", "<").replace(">", ">") return value[:max_length] for lead in all_leads: company = escape_markdown_cell(lead["company"]) title = escape_markdown_cell(lead["title"]) location = escape_markdown_cell(lead["location"]) signals = escape_markdown_cell(", ".join(lead.get("pain_signals", []))) f.write(f"| {company} | {title} | {location} | {signals} |\n") ``` ]]>
