T09 · Insecure Skill Coding Practices
- Location
scripts/ccpa-audit.py:329- Finding
Unescaped Cloud-Controlled Data in Generated HTML Reports
- Content
View full analysis
= 80 else "#ff9800" if score >= 60 else "#f44336" rows = "" current_cat = "" for r in items: if r.get("category_name") != current_cat: current_cat = r.get("category_name", "") rows += f'{current_cat}\n' icon = "✅" if r.get("passed") else "❌" cls = "pass" if r.get("passed") else "fail" rec = r.get("recommendation") or "Keep it up" rows += f"""{icon}{r.get('name')}{r.get('legal_ref') or ''}{cls.upper()}{rec}\n""" return f""" CCPA Compliance Audit Report body{{font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;max-width:960px;margin:2rem auto;padding:0 1rem;color:#333}} h1{{border-bottom:2px solid #2563eb;padding-bottom:.5rem}} .score-card{{background:linear-gradient(135deg,#2563eb,#1d4ed8);color:#fff;padding:2rem;border-radius:12px;text-align:center;margin:1.5rem 0}} .score{{font-size:4rem;font-weight:700}} .summary{{display:flex;gap:2rem;justify-content:center;margin-top:1rem}} .summary div{{text-align:center;font-size:1.2rem}} table{{width:100%;border-collapse:collapse;margin-top:1.5rem}} th{{background:#f1f5f9;text-align:left;padding:.75rem;border-bottom:2px solid #e2e8f0}} td{{padding:.75rem;border-bottom:1px solid #e2e8f0}} tr.pass td:first-child{{color:#4caf50}} tr.fail td:first-child{{color:#f44336}} tr.category-row td{{background:#dbeafe;font-weight:600;color:#1d4ed8}} .note{{color:#94a3b8;margin-top:2rem;font-size:.85rem}}CCPA Compli ...[truncated 2562 chars]
- Remediation
View remediation
``` 5. Add regression tests using hostile values such as: ```text ">``` The tests should verify that these values appear as encoded text and cannot create executable elements. ]]>
