For what security reasons are svgs blocked in the media uploader?

SVG can contain JavaScript. JavaScript can be used to hijack cookies or do other questionable actions. It can even be “hidden” in namespaces:

<html xmlns:ø="http://www.w3.org/1999/xhtml">
   <ø:script src="https://0x.lv/" />
</html>

source

It is very hard to filter that out during the upload, so it is just not allowed by default.

Leave a Comment