Disable blocking of SVG files with JavaScript code

For security reasons, Scalable Vector Graphics (SVG) files with JavaScript code are blocked when you upload media files to the Media Library. You can turn this feature off by creating a patch config file that deletes the validation processor that checks SVG files for JavaScript code. The processor is called CheckSvgForJs and is part of the validateMedia pipeline. Turning off the feature affects all SitecoreAI applications that upload files to the Media Library, for example, Pages, Explorer, and the Content Editor.

To disable blocking of SVG files:

XM Cloud is now SitecoreAI

Some code examples, images, and UI labels may still use XM Cloud while engineering assets are being updated.

  1. Create a patch config file.

  2. Paste the following code into the file:

    RequestResponse
    <?xml version="1.0" encoding="utf-8" ?>
    <configuration xmlns:patch="http://www.sitecore.net/xmlconfig/"
                   xmlns:role="http://www.sitecore.net/xmlconfig/role/">
        <sitecore role:require="!XMCloud">
            <pipelines>
                <validateMedia>
                    <processor type="Sitecore.Pipelines.ValidateMedia.CheckSvgForJs,Sitecore.Kernel" >
                        <patch:delete/>
                    </processor>
                </validateMedia>
            </pipelines>
        </sitecore>
    </configuration>
  3. Save the file to the following folder: /App_Config/Include.

Do you have some feedback for us?

If you have suggestions for improving this article,