Skip to content

fix: sanitize HTML in MarkdownRenderer during SSR - #1247

Merged
RUKAYAT-CODER merged 2 commits into
rinafcode:mainfrom
Benedict315:main
Aug 26, 2026
Merged

fix: sanitize HTML in MarkdownRenderer during SSR#1247
RUKAYAT-CODER merged 2 commits into
rinafcode:mainfrom
Benedict315:main

Conversation

@Benedict315

@Benedict315 Benedict315 commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Remove SSR bypass that returned unsanitized HTML. DOMPurify now runs isomorphically on both server and client to prevent XSS attacks.

  • Remove typeof window check in MarkdownRenderer
  • Add tests verifying DOMPurify sanitization

Description

Fixed SSR XSS vulnerability in MarkdownRenderer by removing the bypass that returned unsanitized HTML during server-side rendering. DOMPurify now sanitizes HTML on both server and client. Added 2 security tests.

Related Issue

Closes #1047

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update

Checklist

  • Code follows project style guidelines
  • Self-review completed
  • No console errors
  • Uses Lucide icons consistently
  • Responsive design implemented
  • Starknet best practices followed

Remove SSR bypass that returned unsanitized HTML. DOMPurify now runs
isomorphically on both server and client to prevent XSS attacks.

- Remove typeof window check in MarkdownRenderer
- Add tests verifying DOMPurify sanitization
@drips-wave

drips-wave Bot commented Aug 26, 2026

Copy link
Copy Markdown

@Benedict315 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@RUKAYAT-CODER

Copy link
Copy Markdown
Contributor

Thank you for contributing to the project.

@RUKAYAT-CODER
RUKAYAT-CODER merged commit d738086 into rinafcode:main Aug 26, 2026
6 checks passed
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.

MarkdownRenderer sends unsanitized HTML during SSR

3 participants