Skip to content

fix: sanitize markdown HTML output with DOMPurify to prevent XSS - #231

Open
AAtomical wants to merge 1 commit into
apconw:masterfrom
AAtomical:fix/sanitize-markdown-html
Open

fix: sanitize markdown HTML output with DOMPurify to prevent XSS#231
AAtomical wants to merge 1 commit into
apconw:masterfrom
AAtomical:fix/sanitize-markdown-html

Conversation

@AAtomical

Copy link
Copy Markdown

markdown-it is configured with html:true, allowing raw HTML to pass through md.render() into v-html unsanitized. Wrap all render outputs with DOMPurify.sanitize() using the existing dompurify dependency.

Affected sinks:

  • MarkdownPreview/index.vue v-html="renderedContent"
  • skill-center.vue v-html="renderedDesc" / v-html="renderedSkillContent"
  • demand-manager.vue v-html="marked(message)"

fix #230

markdown-it is configured with html:true, allowing raw HTML to pass
through md.render() into v-html unsanitized. Wrap all render outputs
with DOMPurify.sanitize() using the existing dompurify dependency.

Affected sinks:
- MarkdownPreview/index.vue v-html="renderedContent"
- skill-center.vue v-html="renderedDesc" / v-html="renderedSkillContent"
- demand-manager.vue v-html="marked(message)"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Stored XSS via markdown-it html: true

1 participant