T09 · Insecure Skill Coding Practices
- Location
scripts/md_to_page.py:25- Finding
Stored HTML and JavaScript Injection in Generated Pages
- Content
View full analysis
str: return html_module.escape(text, quote=False) ``` ```python def inline_md(text: str) -> str: """Convert inline markdown: bold, italic, code, links, images.""" # Images text = re.sub( r'!\[([^\]]*)\]\(([^)]+)\)', lambda m: f'', text, ) # Links text = re.sub( r'\[([^\]]+)\]\(([^)]+)\)', lambda m: f'{m.group(1)}', text, ) # Inline code text = re.sub( r'`([^`]+)`', lambda m: f'
{escape(m.group(1))}', text, ) # Bold text = re.sub(r'\*\*(.+?)\*\*', r'\1', text) # Italic (single *) text = re.sub(r'(?\1', text) return text ``` Representative rendering sinks include: ```python elif btype == 'paragraph': text = inline_md(block[1]) content_html.append(f'{text}
') elif btype == 'blockquote': text = block[1] if text.strip().startswith('💡'): cls = 'callout insight reveal' text = text.replace('💡', '', 1).strip() elif text.strip().startswith('⚠️'): cls = 'callout warn reveal' text = text.replace('⚠️', '', 1).strip() else: cls = 'callout reveal' content_html.append(f'{inline_md(text)}') elif btype == 'ul': items_html = '\n'.join(f'- {inline_md(item)}
- Remediation
View remediation
` tags, event-handler attributes, quote-breaking URLs, encoded `javascript:` URLs, malformed Markdown, and nested directive content. ]]>
