<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Certification How to Use sanitization? in Custom Visuals Development Discussion</title>
    <link>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Certification-How-to-Use-sanitization/m-p/4363802#M12025</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As part of the certification process there is a requirement to: "ensure DOM is manipulated safely. Use sanitization for user input or user data, before adding it to DOM."&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How have others achived this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have implemented the code below to loop through all the data from the user and apply a sanitizeHTML function on it. I am not sure if this is enough.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;  options.dataViews[0].table.rows = options.dataViews[0].table.rows.map(innerArray =&amp;gt;
            innerArray.map(element =&amp;gt; {if (element) { return sanitizeHtml(String(element)); } else return null }));&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 14 Jan 2025 19:17:09 GMT</pubDate>
    <dc:creator>IraJWatt</dc:creator>
    <dc:date>2025-01-14T19:17:09Z</dc:date>
    <item>
      <title>Certification How to Use sanitization?</title>
      <link>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Certification-How-to-Use-sanitization/m-p/4363802#M12025</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As part of the certification process there is a requirement to: "ensure DOM is manipulated safely. Use sanitization for user input or user data, before adding it to DOM."&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How have others achived this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have implemented the code below to loop through all the data from the user and apply a sanitizeHTML function on it. I am not sure if this is enough.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;  options.dataViews[0].table.rows = options.dataViews[0].table.rows.map(innerArray =&amp;gt;
            innerArray.map(element =&amp;gt; {if (element) { return sanitizeHtml(String(element)); } else return null }));&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jan 2025 19:17:09 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Certification-How-to-Use-sanitization/m-p/4363802#M12025</guid>
      <dc:creator>IraJWatt</dc:creator>
      <dc:date>2025-01-14T19:17:09Z</dc:date>
    </item>
    <item>
      <title>Re: Certification How to Use sanitization?</title>
      <link>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Certification-How-to-Use-sanitization/m-p/4363874#M12026</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/827792"&gt;@IraJWatt&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you're using &lt;A href="https://www.npmjs.com/package/sanitize-html" target="_self"&gt;sanitize-html&lt;/A&gt;, this should be enough. However, you may need to consider the permitted tags your HTML may contain to avoid arbitrary execution of JavaScript and potential attempts to load data remotely via attributes like &lt;FONT face="courier new,courier"&gt;src&lt;/FONT&gt;. For the remote loading, setting your WebAccess privilege in your capabilities as directed should prevent this, but you can also manage this within sanitize-html.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If it helps, the HTML Content visual is open source. There is a version called &lt;A href="https://appsource.microsoft.com/en-au/product/power-bi-visuals/coacervolimited1596856650797.htmlcontent_certified" target="_self"&gt;HTML Content (lite)&lt;/A&gt;, certified by MS, so it can be regarded as good enough for HTML sanitization in a certified environment. &lt;A href="https://github.com/dm-p/powerbi-visuals-html-content/blob/97b47d2fddc5bee9d43d3648538e41c1e2a723c0/src/domain-utils.ts#L28-L54" target="_self"&gt;You can review its sanitize-html configuration here&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Good luck!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Daniel&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jan 2025 20:27:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Certification-How-to-Use-sanitization/m-p/4363874#M12026</guid>
      <dc:creator>dm-p</dc:creator>
      <dc:date>2025-01-14T20:27:00Z</dc:date>
    </item>
  </channel>
</rss>

