T09 · Insecure Skill Coding Practices
- Location
scripts/generate_a3.py:911- Finding
Persistent HTML and JavaScript Injection Through Unescaped Report Fields
- Content
View full analysis
{cause} {measures} {owner} {deadline} 📋 ''') return '\n'.join(rows) def build_timeline_rows(timeline): """Build timeline-table rows.""" if isinstance(timeline, dict): timeline = [timeline] if not timeline: timeline = [{}] rows = [] for item in timeline: name = item.get('name', '') phase1 = item.get('phase1', '') phase2 = item.get('phase2', '') phase3 = item.get('phase3', '') milestone = item.get('milestone', '') verification = item.get('verification', '') rows.append(f''' {name} {phase1} {phase2} {phase3} {milestone} {verification} ''') return '\n'.join(rows) ``` ```pytho ...[truncated 4974 chars]- Remediation
View remediation
` content so `` cannot terminate the element. - Avoid inserting untrusted values into JavaScript, CSS, or URL contexts. - Do not mark dynamically constructed, user-controlled row content as safe. 4. Validate parsed JSON structures and scalar types before rendering. Reject unexpected lists, dictionaries, or non-string values in fields expected to contain text. 5. Add automated regression tests using payloads such as: - `` - `` - `
` - Encoded and mixed-case variants of closing tags and event handlers Tests should parse the generated document and verify that payloads appear only as text, not as executable elements or attributes. 6. Add a res ...[truncated 346 chars]
