I don't know very details about SVG standard and it's extensions. But, I've have read, that SVG images can execute some scripts.
Is it safe to display any (user uploaded) SVG image on site?
I don't know very details about SVG standard and it's extensions. But, I've have read, that SVG images can execute some scripts.
Is it safe to display any (user uploaded) SVG image on site?
It should be safe as long as you load them as an <img>
. That includes equivalent uses such as with background-image
. But not safe when inlined, or loaded via <object>
etc.
The browser follows special rules when SVG images are loaded this way. For example, the SVG must be self-contained (ie. no external resources), scripts will not be executed, and :visited
style rules will not be applied.