Skip to content

fix(blog): sanitize post HTML to prevent stored XSS (fixes #57)#58

Closed
FuturMix wants to merge 1 commit into
profullstack:masterfrom
FuturMix:fix/blog-xss-sanitize
Closed

fix(blog): sanitize post HTML to prevent stored XSS (fixes #57)#58
FuturMix wants to merge 1 commit into
profullstack:masterfrom
FuturMix:fix/blog-xss-sanitize

Conversation

@FuturMix

Copy link
Copy Markdown
Contributor

Adds sanitize-html to sanitize blog post HTML before rendering via dangerouslySetInnerHTML.

The post.html field from the autoblog webhook is currently rendered unsanitized. If the upstream source is compromised, arbitrary JS can execute in visitor browsers.

Changes:

  • Add sanitize-html dependency and @types/sanitize-html
  • Sanitize post.html in the blog post component with allowed tags (img, h1-h3) and safe attributes

Fixes #57

@FuturMix

Copy link
Copy Markdown
Contributor Author

@ralyodio This is a critical stored XSS vulnerability — blog post HTML from the autoblog webhook is rendered unsanitized. Could you review and merge this fix? We also have 6 other security fixes ready (PR #60, #62, #66, #67, #68, #70).

@ralyodio ralyodio closed this Jun 14, 2026
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.

Blog post HTML rendered without sanitization (stored XSS)

2 participants