Merged
Conversation
…sanitization # Conflicts: # src/app/components/message/Reply.tsx # src/app/features/room/RoomInput.tsx
Member
Author
|
Should I write a changeset for this? |
Member
Member
Author
|
uh yeah thats because of mxc links, let me see how I can fix it. |
4dfc72d to
fb1732c
Compare
Member
Author
|
okay it should be fixed now. |
Contributor
Deploying with
|
| Status | Preview URL | Commit | Alias | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! | https://pr-571-sable.raspy-dream-bb1d.workers.dev | fb1732c | pr-571 |
Sun, 29 Mar 2026 21:44:51 GMT |
github-merge-queue bot
pushed a commit
that referenced
this pull request
Mar 30, 2026
> [!IMPORTANT] > Merging this PR will create a new release. ## Fixes * Add youtube shorts support to stop it from crashing sable. ([#578](#578) by @nushea) * Fix rich-text reply previews and custom-formatted messages so unsafe HTML is filtered more strictly and Matrix colors render correctly. ([#571](#571) by @hazre) * Fix crash when previewing non-video YouTube URLs (channels, @Handles, etc.) that lack query parameters. ([#584](#584) by @Just-Insane) * fix id handling and id generation for Personas ([#583](#583) by @dozro)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Description
sanitize-htmltoDOMPurifymxc://restrictionsformatted_bodynever reaches the reply extraction path unsanitizeddata-mx-coloranddata-mx-bg-colortranslation to render time and explicitly ignore incomingstylein the HTML parsersanitizeTextfor plain-text interpolation paths that were previously running through the HTML sanitizerType of change
Checklist:
AI disclosure:
This PR replaces the Matrix custom HTML sanitizer with a DOMPurify-based implementation that matches the Matrix v1.18 allowlist instead of the broader legacy rules. The sanitizer now validates tag-specific attributes, rejects incoming
style, limits links tohttps/http/ftp/mailto/magnet, limits images tomxc://, stripsmx-reply, and keeps the existing nesting guard. Reply previews now sanitizeformatted_bodybefore any reply trimming or parsing. The React HTML parser now turnsdata-mx-coloranddata-mx-bg-colorinto React styles at render time and ignores raw incomingstyleattributes even if unsanitized HTML somehow reaches the parser. The plain-text HTML interpolation paths in forwarding, the room composer, and the message editor now use text escaping instead of the HTML allowlist sanitizer. The new tests lock down the sanitizer contract, the reply-preview regression, parser color translation, and parser-side style stripping.