CyberAP
Well-known member
I understand that exposing svg directly into the document is really a bad idea for security reasons, but when served in an img tag it can cause no harm as it doesn't have any access to the outer document scope at all, also any Javascript within the SVG wouldn't even execute with that method.
Interestingly enough SVG do work if you try to embed them in the editor but fail to display after you post the message.
Considering a security issue with direct navigation to the proxied SVG I can think of this solution: when navigating to the direct path of that SVG serve a wrapper html with SVG within an img tag. That would help in 99% of the cases. Another solution would be to proxy every SVG into an SVG wrapper that serves an image with an
Basic example: http://jsfiddle.net/rfjoj2zn/
Interestingly enough SVG do work if you try to embed them in the editor but fail to display after you post the message.
Considering a security issue with direct navigation to the proxied SVG I can think of this solution: when navigating to the direct path of that SVG serve a wrapper html with SVG within an img tag. That would help in 99% of the cases. Another solution would be to proxy every SVG into an SVG wrapper that serves an image with an
image
tag.Basic example: http://jsfiddle.net/rfjoj2zn/
Last edited:
Upvote
3