如何使SVG安全使用?

时间:2019-06-07 14:50:09

标签: security svg

我正在为设计系统创建一组自定义图标。我想通过使用以下内容来了解​​是否存在安全漏洞:

1-Inline SVG

<svg class="svg-inline--fa fa-search fa-w-16 form-control-feedback" aria-hidden="true" data-prefix="fa" data-icon="search" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" data-fa-i2svg=""><path fill="currentColor" d="M505 442.7L405.3 343c-4.5-4.5-10.6-7-17-7H372c27.6-35.3 44-79.7 44-128C416 93.1 322.9 0 208 0S0 93.1 0 208s93.1 208 208 208c48.3 0 92.7-16.4 128-44v16.3c0 6.4 2.5 12.5 7 17l99.7 99.7c9.4 9.4 24.6 9.4 33.9 0l28.3-28.3c9.4-9.4 9.4-24.6.1-34zM208 336c-70.7 0-128-57.2-128-128 0-70.7 57.2-128 128-128 70.7 0 128 57.2 128 128 0 70.7-57.2 128-128 128z"></path></svg>

2-调用服务器中托管的文件

<img class="img-fluid" src="images/search.svg">

3-根本不使用它们,而是创建自定义图标字体。但是,对于设计人员和开发人员而言,维护费用要高得多,没有考虑到在某些情况下它们可能无法正确加载。

0 个答案:

没有答案