Static analysis: Fix usage of XmlReader to ensure XmlResolver is null (#4108)

* the default XmlResolver will attempt to resolve external resources, recommendation is to explicitly set to null which
will raise exception if malicious xml attempts to cause xmlreader to access external resources

* added DTDProcessing and related to XmlReaderSettings
This commit is contained in:
Steve Lee authored and Mike Richmond committed 2017-07-06 09:09:57 -07:00
1 parent dda482eaac
commit 36eaab2809
8 files changed
+7 -21

No files matched your search

@@ -135,7 +135,7 @@ namespace Microsoft.PowerShell.Workflow
{
project.AddItem("XamlAppDef", file);
XamlXmlReader reader = new XamlXmlReader(XmlReader.Create(file), new XamlSchemaContext());
XamlXmlReader reader = new XamlXmlReader(XmlReader.Create(file, new XmlReaderSettings { XmlResolver = null }), new XamlSchemaContext());
using (reader)
{
while (reader.Read())