This repository has been archived by the owner on Sep 11, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 831
Conversation
This file contains 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
Contributor
t3chguy
added
the
T-Enhancement
New features, changes in functionality, performance boosts, user-facing improvements
label
Oct 25, 2021
Sadly, not having the time to finish this. Although I might come back to this. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
T-Enhancement
New features, changes in functionality, performance boosts, user-facing improvements
Z-Community-PR
Issue is solved by a community member's PR
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
This PR adds a sanitizer that enables use of dataURLs for svg Blobs. Right now all files with the MIME-type
image/svg+xml
are getting converted to aapplication/octet-stream
, which breaks the lightbox view.How it currently looks like:
How it should look like:
A proper lightbox is displayed.
Security
It also fixes a security issue where SVGs can be forwarded to e2e encrypted rooms and possibly steal the encryption keys.
I would highly appreciate feedback regarding the use of DOMPurify. Especially the way I make tags work with the sanitizer. I did this because during my testing many SVG made heavy use of them.
Related issues
The idea of using DOMPurify was originally mentioned here as I found out later: element-hq/element-web#2581
I am looking into looking into this specific issue next, but for now it should fix the following issues:
Current status:
Signed-off-by: Alexander Stephan alexander.stephan@tum.de
Here's what your changelog entry will look like:
✨ Features
Preview: https://61771aa1667ae2e7582564a3--matrix-react-sdk.netlify.app
⚠️ Do you trust the author of this PR? Maybe this build will steal your keys or give you malware. Exercise caution. Use test accounts.