Summary
Preventive hardening note: chat is currently safe (createElement / textContent in chat-message-content.js). marked + DOMPurify already exist for release notes. If chat Markdown ships later, it must reuse sanitize with a strict allowlist — never ad-hoc innerHTML from peer text.
Requirements when the feature lands
marked.parse → DOMPurify.sanitize with explicit ALLOWED_TAGS / URI rules
- No unrestricted
<img> / javascript: hrefs
- Prefer extracting a shared helper next to
release-markdown.js rather than a second sanitizer in chat
Acceptance (for this tracking issue)
Summary
Preventive hardening note: chat is currently safe (
createElement/textContentinchat-message-content.js).marked+DOMPurifyalready exist for release notes. If chat Markdown ships later, it must reuse sanitize with a strict allowlist — never ad-hocinnerHTMLfrom peer text.Requirements when the feature lands
marked.parse→DOMPurify.sanitizewith explicitALLOWED_TAGS/ URI rules<img>/javascript:hrefsrelease-markdown.jsrather than a second sanitizer in chatAcceptance (for this tracking issue)