Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(plugin): SVGEmbed #2432

Open
wants to merge 7 commits into
base: dev
Choose a base branch
from
Open

feat(plugin): SVGEmbed #2432

wants to merge 7 commits into from

Conversation

aamiaa
Copy link
Contributor

@aamiaa aamiaa commented May 10, 2024

This plugin makes SVG files embed like normal images. It supports svg files uploaded directly to Discord, as well as svg files linked via a discord.com or cdn.discordapp.com url.

It patches the existing image embed logic to recognize .svg files as valid images and have them embed the same way (i.e. via img src attribute), so there should be no XSS incidents.

@aamiaa aamiaa changed the base branch from main to dev May 11, 2024 19:07
Copy link
Owner

@Vendicated Vendicated left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

honestly looks good but i'm still scared about potential XSS D:

have u tested this with some sussy svgs to make sure they are properly handled?

src/plugins/svgEmbed/index.ts Outdated Show resolved Hide resolved
@aamiaa
Copy link
Contributor Author

aamiaa commented May 24, 2024

honestly looks good but i'm still scared about potential XSS D:

have u tested this with some sussy svgs to make sure they are properly handled?

I've tested it against a random SVG to which I've manually appended <script> tags, as well as a random one I've found online by googling "svg xss". No javascript was executed in either case.

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.

None yet

3 participants