Тест .svg выглядит следующим образом: < /p>
&xxe;
< /code>
И мой код выглядит следующим образом: < /p>
using Aspose.Html;
using Aspose.Html.Converters;
using Aspose.Html.Dom.Svg;
using Aspose.Html.Saving;
License license = new License();
license.SetLicense(@"C:\temp\Aspose License\Aspose.Total.lic");
string svgPath
string pngPath = "output.png";
var configuration = new Aspose.Html.Configuration();
//https://reference.aspose.com/html/net/a ... l/sandbox/
configuration.Security |= Sandbox.Navigation;
configuration.Security |= Sandbox.AuxiliaryNavigation;
configuration.Security |= Sandbox.TopLevelNavigation;
configuration.Security |= Sandbox.Plugins;
configuration.Security |= Sandbox.Origin;
configuration.Security |= Sandbox.Forms;
configuration.Security |= Sandbox.Scripts;
configuration.Security |= Sandbox.PointerLock;
configuration.Security |= Sandbox.AutomaticFeatures;
configuration.Security |= Sandbox.Fullscreen;
configuration.Security |= Sandbox.DocumentDomain;
configuration.Security |= Sandbox.Images;
using (var document = new SVGDocument(svgPath, configuration))
{
var options = new ImageSaveOptions(Aspose.Html.Rendering.Image.ImageFormat.Png);
Converter.ConvertSVG(document, options, pngPath);
}
< /code>
Неважно, какие параметры безопасности я пробую, я всегда получаю содержимое файла моего хоста в предварительном просмотре. Есть ли другие параметры безопасности, которые я могу попробовать?
Подробнее здесь: https://stackoverflow.com/questions/793 ... -injection
Мобильная версия