T09 · Insecure Skill Coding Practices
- Location
scripts/report_to_html.py:179- Finding
Unescaped Markdown Content Enables Stored HTML and JavaScript Injection
- Content
View full analysis
{apply_inline(c)}' for c in row ) ``` ```python if stripped.startswith('# '): text = stripped[2:] html_parts.append(f'{apply_inline(text)}
') elif stripped.startswith('## '): text = stripped[3:] html_parts.append(f'{apply_inline(text)}
') elif stripped.startswith('### '): text = stripped[4:] html_parts.append(f'{apply_inline(text)}
') # Unordered list elif stripped.startswith('- ') or stripped.startswith('* '): if not in_list: html_parts.append('- ')
in_list = True
text = stripped[2:]
html_parts.append(f'
- {apply_inline(text)} ') # Ordered list elif re.match(r'^\d+\.\s', stripped): if not in_list: html_parts.append('
- {apply_inline(text)} ') ``` ```python def apply_inline(text): """Apply inline markdown formatting.""" # Bold text = re.sub(r'\*\*(.+?)\*\*', r'\1', text) # Italic text = re.sub(r'\*(.+?)\*', r'\1', text) # Inline code text = re.sub(r'`(.+? ...[truncated 3196 chars]
- ')
in_list = True
text = re.sub(r'^\d+\.\s', '', stripped)
html_parts.append(f'
- Remediation
View remediation
` elements. - `` elements with `onerror`. - SVG-based event handlers. - Attribute-breaking quotation marks. - `javascript:` and encoded dangerous URL schemes. - Malicious content in headings, paragraphs, tables, lists, inline code, link labels, and link destinations. 7. Document that source reports and imported data are untrusted inputs and must remain encoded throughout the Markdown-to-HTML conversion pipeline. ]]>
